MicroBeat: the Custom Routine Dancing Game

by egbabc in Circuits > Microcontrollers

1061 Views, 5 Favorites, 0 Comments

MicroBeat: the Custom Routine Dancing Game

53D8B943-54F6-4EF5-803A-029F6CDBD9FF.jpeg

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

3F0CEBA2-E36A-448C-BB7A-9C64999790D3.png
3C8D904D-4A72-4AE1-94A6-DAA0D69BDCE6.jpeg

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

377EF3E6-B566-4D1C-9967-B342D92DF0EE.jpeg
A65EB95E-AC77-4EF6-9AA6-7EF9C2E97489.jpeg

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:

  1. A code chunk attached to button “A” that starts recording using variable “Recording”
  2. A code chunk that assigns numbers to motions and orders them in a list
  3. A code chunk that ensures there is only a new motion every half of a second
  4. A code chunk that displays a blinking light in the middle of the screen when the Microbit is recording
  5. A code chunk attached to button “B” that stops recording

One MicroBit: Displaying Movements

50C5C006-E1B7-4D25-BB71-0CBBA3AB6C06.jpeg
B71412CC-6C96-4813-9238-508EDD35E218.jpeg
912F4A61-7112-4611-9FAF-B5FBE1257584.jpeg

This is the final step for 1 Microbit Version. Scroll to end to get 3D printed files and assembly!


Here we see:

  1. A code chunk initiating the sequence when BOTH “A” and “B” are pressed
  2. 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.
  3. A code chunk that repeats the rest by the length of the list
  4. 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
  5. A code chunk with a variable “List Counter” getting change by +1 each repetition
  6. 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.
  7. A code chunk assigning a display to each movement
  8. 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

516960F6-5016-4905-90A8-19ECD718C010.jpeg
5305BD2C-3116-4FF2-A11A-3A169E9659B4.jpeg
78C134F4-B80A-4589-96E3-34F5E82D4BA4.jpeg

This is where 2 Microbits starts!


Here we see:

  1. A code chunk resetting variables that you will see later
  2. The same move recording sequence as used for the 1 Microbit version
  3. 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

10FA8B97-15D9-431A-9B72-A25781D3B7E3.jpeg
6EC6D9D0-8F54-4004-B75D-AD214A1D2C6B.jpeg

There’s a lot to unpack here, so let’s split it up into chunks:

Chunk 1: Sending Information

  1. A code chunk sending a countdown to the other microbit when “A” and “B” are pressed at the same time
  2. 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

  1. A chunk of text associated with each movement changing score by 1
  2. If you do the action that is sent to be displayed, then you get a point
  3. A chunk of text sending a “done” message after all actions have been performed
  4. A chunk of text scoring you
  5. Your score is basically 1000 * (your score/possible points [the length of the list])
  6. 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

83507799-6ABA-41E8-AA43-16E70C048A06.png
273599D7-4E22-4038-9626-AF59380F961B.png
48B9FD98-45D9-4869-B454-9E9F45EE6783.png

This is the final and (perhaps) simplest step of all


Here we see:

  1. Images associated with each action to indicate what to do to get scored correctly
  2. The countdown and “done” messages display
  3. the final display of score, jointing the word “Score:” with your score

Optional (Wristband Assembly)

4E99B520-FA56-4867-8848-023ED6D8B521.jpeg
3A36DBC4-46DA-4A7E-8CD2-517AB8E21C14.jpeg
9E75FAD7-CC81-4246-A350-B2999B6235C7.jpeg
B4513C16-8B89-4736-AEAE-C118220B0E1E.jpeg
E02E9807-F862-4B9C-A790-D8D098403860.jpeg

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!

Downloads