bitty controller micro:bit code

Using MakeCode to create code for GiggleBot

GiggleBot uses something called I2C which is pronounced "I squared C" to communicate with its various components, such as the motors that drive the wheels. This is a different approach to some other bots which require you to write analog or digital values to specific micro:bit pins to control the direction and speed of motors but... it turns out to be very easy to use, especially since MakeCode has I2C blocks available.

When using I2C, we're required to specify an I2C address and a value. In our case, the I2C address for the GiggleBot motors is 4. Best of all, GiggleBot's use of I2C allows us to provide a command meaning "set the power to the motors" and values for the power level of each of the two motors in a single operation, represented by a single MakeCode block.

The Bluetooth communication between Bitty Controller and the GiggleBot is the same as for other bots and varies depending on whether you are using the D-Pad UI, the touchpad UI or the touchpad with sensor data UI. Review other Bitty Controller tutorials to see more details on this topic.

You can download ready made hex files for use with a GiggleBot or you can make your own from the code presented below.

GiggleBot D-Pad Control

MakeCode project

GiggleBot Touchpad Control - no sensor data

MakeCode project

GiggleBot Enhanced Touchpad Control - Line following, light and temperature sensor data

MakeCode project

GiggleBot Touchpad plus buttons for projects such as dogbot

MakeCode project