mBot loves to get it’s LED faceplace installed and go dancing. But first it needs the right program.
This is what we’ll be building – a dancing mBot with flashing lights and a changing expression (face) on the LCD display! All you need to do is press the button of the mBot for the action to begin!
mBot needs the correct faceplate installed. Make sure you have the LED display installed, not the default ultrasonic sensors.
Just make a note of which port your connect the LCD faceplate into. By that – I mean follow the wire from the back of the LCD display to wherever you plugged it in. They’re all clearly numbered. In my case, it’s port 3.
First – some lights!
On the top of the mBot are some LEDs we can program. We need to handle the push button event.
Create a variable called DanceTime (under Data & Blocks).
Once you’ve done that, create this block of code
Once you’ve done that, we need to handle those two broadcasts – StartDancing and StopDancing
The StartDancing block changes the colours of the two LEDs. You can have fun changing it to whatever you like.
Dance Face and Moves
mBot is only learning to dance. It (or perhaps he or she?) does a simple dance of moving forward, stopping, rotating about 90 degrees and repeating.