MicroBeat: the Custom Routine Dancing Game
by egbabc in Circuits > Microcontrollers
1140 Views, 5 Favorites, 0 Comments
MicroBeat: the Custom Routine Dancing Game
Meet the MicroBeat: The portable JustDance-like dancing game for your wrist!
This armband uses Microbit sensing technology to sort your moves into different categories, and display them to you using the five by five LED screen. First, you hit the record button and dance to your heart’s content. Once you feel that your routine is finished, just press the stop record button and all your separate moves will be ready and stored in the microbit for replaying. If you have two microbits, you can hit start, and the moves from your routine will be shown through the second Microbit, while the first one keeps track of how close you’re coming to those moves, and scores you accordingly. The routine is saved and can be played multiple times to compare your friends and family and see what scores they get! If you only have one Microbit, don’t worry! There’s an option for you too. Once you are done recording your routine, take off the watch and use it’s custom designed stand feature to allow it to play your moves back to you! While it doesn’t keep track of score, it’s certainly a fun option to let all of you with only one MicroBit (myself included) get a taste of the action!
In this instructable you will learn how to build both the 1 Microbit version, and the 2 MicroBit version that keeps track of your score, as well as adaptations for the microbit first and second editions.
If you just came for the code, no sweat! Just download the .hex files linked to this step!
Supplies
All you really need for this project is your microbit(s) and your computer! However, if you want to add the wristband option for ease of use, you’ll need a 3D printer and some Velcro straps. If you don’t have a 3D printer, you can always design your own wristband!
One MicroBit: Recording Movements
This step is to record the movements for the 1 bit version. If you came for the two player version, keep scrolling!
Here we see:
- A code chunk attached to button “A” that starts recording using variable “Recording”
- A code chunk that assigns numbers to motions and orders them in a list
- A code chunk that ensures there is only a new motion every half of a second
- A code chunk that displays a blinking light in the middle of the screen when the Microbit is recording
- A code chunk attached to button “B” that stops recording
One MicroBit: Displaying Movements
This is the final step for 1 Microbit Version. Scroll to end to get 3D printed files and assembly!
Here we see:
- A code chunk initiating the sequence when BOTH “A” and “B” are pressed
- this is what will be played back to you. You won’t have it on your wrist when you press them, rather in a visible spot on a table or other object in front of you.
- A code chunk that repeats the rest by the length of the list
- This is to make sure that the code ends when we run out of moves, as every move adds one to the length of the list
- A code chunk with a variable “List Counter” getting change by +1 each repetition
- This is to find which item of the list we are on. After 8 repetitions for example, list counter will go to 9. The code will then look at the 9th item in the list of moves to know which one to show you.
- A code chunk assigning a display to each movement
- These show you what to do and can be seen by looking at the number associated with each, and comparing that number to the numbers associated with the actions. Feel free to change these if you see fit!
Two Microbits: Recording Movements and Resetting Variables
This is where 2 Microbits starts!
Here we see:
- A code chunk resetting variables that you will see later
- The same move recording sequence as used for the 1 Microbit version
- If you’re confused, I would suggest scrolling back to see what you missed in the 1 Microbit tutorial
Two Microbits: Sending Movements and Scoring
There’s a lot to unpack here, so let’s split it up into chunks:
Chunk 1: Sending Information
- A code chunk sending a countdown to the other microbit when “A” and “B” are pressed at the same time
- The same basic system to get the actions as with the first Microbit (I would suggest looking back) except this time, instead of displaying, it sends a message to the other microbit to display it.
Chunk 2: Scoring
- A chunk of text associated with each movement changing score by 1
- If you do the action that is sent to be displayed, then you get a point
- A chunk of text sending a “done” message after all actions have been performed
- A chunk of text scoring you
- Your score is basically 1000 * (your score/possible points [the length of the list])
- an optional feature is built into the code to add pauses. This means that instead of getting a point for every time there is a pause or a “do nothing” action, it will subtract that number from the total length of list when scoring, as not to boost your score from pauses. To initiate this, replace “add one to score” with “add one to pauses”
Two Microbits: Display
This is the final and (perhaps) simplest step of all
Here we see:
- Images associated with each action to indicate what to do to get scored correctly
- The countdown and “done” messages display
- the final display of score, jointing the word “Score:” with your score
Optional (Wristband Assembly)
This is the final (optional) step for either option. Using this basic holder design: https://www.thingiverse.com/thing:2666671, I modified it to create a wristband-suitable design. Print out the attached .stl file, and you’re good to go! Just use some twine, Velcro, or other fastener to strap it around your wrist, insert the battery pack and microbit, and get dancing!