Pi Supply bit:buggy Project 05 – Crazy Dance
In the last project we showed you how to control the LEDs on the bit:buggy, now we are going to create some awe inspiring dance moves into the mix with some crazy snazzy dance moves.
Connect your hardware
If you haven’t done so already, connect the left servo wheel to P1 and the right servo wheel to P2.
Step 1 – Snap in place the block “go straight at full speed” into the “On start” block. The port number is the actual servo connection port.
Step 2 – Snap into place a “forever” block so we can loop our blocks of code continuously, add a variable block for “left” and “right”. In the variable we want to create a random number between -100 and 100. This will make the bit:buggy move in a random motion.
Step 3 – Under the variables we just created go ahead and ad the block “set left wheel speed left set right wheel speed right”. Pause the code for 1000ms.
Step 4 – Upload your sketch to the bit:buggy
Here is the program link – https://makecode.microbit.org/_C6scgyF3xLWm
Once you have powered on the bit:buggy it should dance and move in random directions.
Taking it further
How can you make the bit:buggy move at a slower speed?
- Project 01 – Full speed ahead
- Project 02 – Make a shape
- Project 03 – Turn at an angle
- Project 04 – Here comes the police
- Project 05 – Crazy dance
- Project 06 – Remote control
- Project 07 – Turns over detection
- Project 08 – Light follow
- Project 09 – Remote control by an accelerometer
- Project 10 – Smart crashproof car