Skip to main content

1.1

Major VersionM

by Pete Prodoehl

Introduction

Build a Reaction Game and test how quickly you can press a button when an LED lights up. We'll use a 7 Segment Display as our scoreboard.

Video Overview

Featured Document

  1. We’re going to use a micro:bit along with our Bit Board and some Crazy Circuits parts to make a fun game that will test your reaction time.
    • We’re going to use a micro:bit along with our Bit Board and some Crazy Circuits parts to make a fun game that will test your reaction time.

    • Game design involves thinking about the game objective, rules, parameters, mechanics, and playability. We started with this slide exploring how our game would work.

    • A series of LEDs will light up in sequence, and when the fourth LED is lit you need to press the button. If you time it right you’ll get a point!

    • When you get 25 points you’ll win the game!

    • But wait! Each time you press the button successfully the game will speed up… and if you press the button at the wrong time you’re score will go down.

    • We’ve written all the code, and our attached PDF will show you what to change to affect the gameplay. You can make it easier or much more difficult!

    • Hey! If you don't have a 7 Segment Display (or don't want to use one) we have another version of this guide which uses the micro:bit's built-in LED matrix to show the score: Reaction Game (LED Version)

  2. Using a LEGO baseplate determine your layout and then put all of your components down connecting them to the correct pins on the Bit Board using 1/8” Maker Tape. Remember, Maker Tape is conductive on both sides and all the way through, so if you need to overlap pieces of it, they’ll still make the needed connections just fine.
    • Using a LEGO baseplate determine your layout and then put all of your components down connecting them to the correct pins on the Bit Board using 1/8” Maker Tape.

    • Remember, Maker Tape is conductive on both sides and all the way through, so if you need to overlap pieces of it, they’ll still make the needed connections just fine.

    • Feel free to adjust the layout if desired. Maybe you want more space between your LEDs, or want the button placed somewhere else… As long as everything connects to the correct pin it should work fine.

    • The attached PDF for this guide has more information and details for the project.

  3. We’re going to use four F/F Jumper Wires to connect our scorebord. There’s a great extension named TM1637 that makes it very easy to show numbers on the display. Perfect for our scoreboard! Plug the 7 Segment Display CLK into Pin 1, DIO into Pin 0, VCC into the + (positive) column, and GND into the - (negative) column. The pins next to the numbers 1, 0, 15, 14, and 13 each connect to the corresponding digital input/output pin on the micro:bit
    • We’re going to use four F/F Jumper Wires to connect our scorebord. There’s a great extension named TM1637 that makes it very easy to show numbers on the display. Perfect for our scoreboard!

    • Plug the 7 Segment Display CLK into Pin 1, DIO into Pin 0, VCC into the + (positive) column, and GND into the - (negative) column.

    • The pins next to the numbers 1, 0, 15, 14, and 13 each connect to the corresponding digital input/output pin on the micro:bit

    • The pins in the + (positive) column are all connected together and go to the 3.3v power supplied by the Bit Board or micro:bit

    • The pins in the - (negative) column are all connected together and go to the common ground connection of the Bit Board and micro:bit

    • Note: Wire color in photo may not match wire color in diagram. The important part is to match which wire connects to which pin.

  4. We placed our 7 Segment Display off to the side and just used a few LEGO parts and one of our favorite mounting techniques… a rubber band!
    • We placed our 7 Segment Display off to the side and just used a few LEGO parts and one of our favorite mounting techniques… a rubber band!

    • You are welcome to get fancy with some LEGO bricks and build something more elaborate if desired.

  5. Connect a USB cable to the micro:bit and then plug it into your computer.
    • Connect a USB cable to the micro:bit and then plug it into your computer.

    • We'll be using makecode.microbit.org to program our board. It uses a simple drag and drop block interface.

    • We're going to load the following code for our Reaction Game program: https://makecode.microbit.org/_Tj38zY2ww...

    • The attached PDF for this guide goes into great details explaining the code and what each section does.

  6. Ready to play? Let’s do it! Once you’ve got the code loaded the game should start right away.
    • Ready to play? Let’s do it!

    • Once you’ve got the code loaded the game should start right away.

    • Get ready to press the button when the fourth LED lights up.

    • Press it at the right time and you get a point! Press it at the wrong time and you lose a point!

    • Every time you get a point the game will speed up.

    • When you win you’ll hear a victory sound and the game will restart so you can try again.

    • If you want to start over or let someone else play, just press the B button on the micro:bit to start a new game.

  7. In the attached PDF we’ve highlighted what parts of the code can be changed to adjust the gameplay. You can change the desired score, the initial speed of the game, and how much faster it speeds up after each correct press.
    • In the attached PDF we’ve highlighted what parts of the code can be changed to adjust the gameplay.

    • You can change the desired score, the initial speed of the game, and how much faster it speeds up after each correct press.

    • While we set the defaults to what we considered to be challenging but not too difficult, you should feel free to adjust things and see what happens!

Finish Line

Attached Documents

Pete Prodoehl

Member since: 03/04/2020

131 Reputation

118 Guides authored

0 Comments

Add Comment

View Statistics:

Past 24 Hours: 0

Past 7 Days: 1

Past 30 Days: 12

All Time: 90