Christmas Candies Ejector
The Christmas day is coming now! Let’s make a candies ejector to send out candies to Children.
*For a more direct show in the GIF, I’ve changed the trigger of the ejection with the button, actually the project is triggered by the noise sensor.
micro:bit V2 x 1
Motor x 1
Bricks x n
The build-up in this picture is a little complicated, here goes the displaying for parts of it only. Do not let our assembly steps limit your own amazing build-up ideas!
Candies holder(Note: please take the size of the holder and the channel into consideration with the candies, the candies in square shape are recommended here)
3.Ejection device: here the ejection is made with the elasticity of the device itself.
Connect the motor to M1 port on the Nezha expansion board.
Go to MakeCode editor:（https://makecode.microbit.org/#editor）Click “Advanced” in the drawer to see more choices.
Search with “Nezha” in the dialogue box to download it.
Show icon while on start
Save the variable “i ”as the sound level.
Judge if the variable is over 90.
If yes, set the motor connecting with M1 to rotate at the speed of -100%, and pause with the time given by the formula（1000 plus the mapping value from 90~255 to 0~3000）.
IStop the motor.
If the kids come in the front of the device, they will not get the candy with a small voice. If their voice is big enough, the device starts and begins ejecting the candies out. The louder the sound is, the more the candies will be sent out.
Share this post
About the Author
ELECFREAKS focuses on microbit and publishes interesting articles
- Micro bit supplier
- Wholesale Suppliers
- Micro bit tutorial
- Micro bit classroom pack
- Mcorbit Environment Monitoring
- TPBot car
- Micro:bit car
- AI Lens
- Micor:bit AI Lens
- Microbit gyroscope
- Micro:bit LEDs
- BBC micro:bit
- Micro:bit Manipulator
- Wukong board
- Micro:bit Motorcycle
- Nezha breakout
- Micro:bit DIY
- 360° servos
- AI Lens