Purpose
This week we would make a simple case suitable for playing with children. This is a wheel of fortune that we can play fun games with children. For example, for children who don’t like eating fruits, we can fill in some fruit options into the turntable, and leave some lucky options for kids. We may alo let the children fill in the fruits and lucky options by themselves, and then randomly select them through this device.
In the gif animation, we can see that my turntable is only a round piece of paper. This is just a substitute and you can design and replace the sticker as you wish.
Materails
micro:bit V2 x 1
Motor x 1
Button brick x 1
Bricks x n
Assembly
You can build it with reference to the following figures, where the structure of the big gear driving the small gear is used to accelerate the speed of the turntable.
Hardware Connections
CConnect the motor to M1 port and button to J1 port on the Nezha expansion board.
Software Programming
Go to MakeCode programming page:(https://makecode.microbit.org/#editor) Click “Advanced” in the drawer to see more choices and click “Extensions”.
Search with “Nezha” extension in the dialogue box and add it.
Search with “PlanetX” and add the package.
Programming
1.Set to show icon in the on start brick.
2.In forever brick, set the speed of the motor connecting to M1 at the speed of 50% while pressing button D, and randomly pause for 2500ms~5000ms, then stop the motor.
Full code:
Link:https://makecode.microbit.org/_VdRaTfeaTYJP
Result
After powering on, press button D, the turntable turns randomly among 2.5s~5s and then stops turning.