Click New Project, and give it a name ( "Reaction Timer")
Step 1: Set Up Your Variables
- Click Variables → Make a Variable → Name it startTime
- Create another variable called endTime
- Create a third variable called reactionTime
Step 2: Display Instructions
- In the on start block:
- Add show string "Get Ready!"
Step 3: Create the Game Trigger
- Use the input block:
- Drag in on button A pressed
- Inside it, do the following:
- Add show string "Wait..."
- Add pause (random ms between 2000 and 5000)
- (Found under Math → pick random 2000 to 5000)
- Add show icon (target) or show LED pattern as the signal
- Set startTime to running time (ms)
- (From input → running time)
Step 4: Detect User Reaction
- Use on button B pressed:
- Set endTime to running time
- Set reactionTime = endTime - startTime
- Show reactionTime on the LED screen
Step 5: Optional – Add Feedback
- After showing the time:
- If reactionTime < 300, show icon happy
- Else, show icon meh
- (Use an if else block from Logic)