Real Life Mario Block
by lebiosphere56 in Circuits > Microcontrollers
452 Views, 1 Favorites, 0 Comments
Real Life Mario Block
Me and my students (9th grade) are transforming our middle school corridor into a real life Mario Bros Parkour thanks to radio connected Micro:bits.
Supplies
For each light block, you will need :
- A cube of your choice,
- A Micro:bit
- A Micro:bit Grove Sheild
- A Grove LED strip
Micro:bit to PC
Plug your first Micro:bit to your PC with the USB connector.
Vittascience
In France, we use the Vittascience web interface to program Micro:bit. On Vittascience, all the libraries are already installed.
If you use Microsoft MakeCode instead, you must add the "Neopixel" library.
- Select "+Extension" (1) in the vertical functions list.
- Then select "Neopixel" (2)
Now, you can code.
Upload that code into your first Micro:bit by pressing "Télécharger"
You can go to the link to find the source on :
https://fr.vittascience.com/microbit/?link=615cbe84639f9&mode=blocks&simu=1
The algorithm is simple :
- Initialise radio channel
- Switch of the light.
- Wait for a signal to switch on the light ("A" pressed or "step1" radio message)
- Wait for checking to switch of the light and send the "step2" radio message to the next block.
- GOTO 3
If you prefer the MakeCode version, you'd better use this link :
Downloads
Plug the Light
Fit the Micro:bit into the Grove shield.
Plug the Neopixel strip to the P0 output.
Then plug the batteries
Put Every Thing in the Cube
Put your electronic stuff in the first block cube.
Then suspend it to the corridor ceiling.
Do It Again
From step 1 to step 5, do it again with the other blocks.
But you must change the radio messages in order to see your parkour enlight in the correct order.
- For the second block, replace A by "step2" and B by "step3".
- For the third block, replace A by "step3" and B by "step4".
- For the fourth block, replace A by "step4" and B by "step5".
And so on.
Until the last block where you will replace B by "step1" in order to enlight the first block again.
Run
Press the "A" button on the first block to start the game.
Now put a red cap, run in your middle school corridor and hurt the blocks as they enlight.