Skip to content

microbit-and-chips/reaction-timer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reaction timer - BBC micro:bit

Introduction

This MicroPython software for the micro:bit implements a simple reaction timer.

Output is via the serial port, so you can

  1. Run it with mu and use mu's REPL to display the results, or
  2. Connect it to a Raspberry Pi or some other computer and do something interesting with the output!

What does it do?

  1. The program starts by displaying a clock image.
  2. Next, it picks a random time to wait, ranging from 500 ms to 4500 ms.
  3. When the time has run out it displays a happy face.
  4. It waits to see how long you take to press button a on the micro:bit, and prints the time in tenths of a second.
  5. If you press button a before the happy face is displayed it will tell you that you are naughty!
  6. It loops back and starts again.

You can quit the program at any time by pressing button b.

Here's some sample output displayed in mu's REPL:

Sample output

About

A simple reaction timer for the micro-bit

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages