This tutorial contains a series of small activities to help you learn how to control the MiP robot using Bluetooth.
You will need to determine what the MAC address or Bluetooth ID is for the MiP robot you want to connect to.
On Linux or Windows, the MAC address applies for a specific MiP on any computer. However on macOS, the Bluetooth ID for any given MiP robot will be different on each computer due to how macOS Bluetooth works.
The tutorial steps can be run either on your computer, or on a Bluetooth enabled microcontroller such as the Pimoroni Badger2040-W.
This first step tests that the MiP is connected correctly to your computer by turning on the chest LED.
go run ./tutorial/step1/ [MAC address or Bluetooth ID]
Press "Control-C" to stop the program.
tinygo flash -target badger2040-w -ldflags="-X main.DeviceAddress=[MAC address]" ./tutorial/step1/
Rolls forwards and backwards.
go run ./step2/ [MAC address or Bluetooth ID]
Press "Control-C" to stop the program.
tinygo flash -target badger2040-w -ldflags="-X main.DeviceAddress=[MAC address]" ./tutorial/step2/
Rolls in a square pattern.
go run ./step3/ [MAC address or Bluetooth ID]
Press "Control-C" to stop the program.
tinygo flash -target badger2040-w -ldflags="-X main.DeviceAddress=[MAC address]" ./tutorial/step3/
Rolls forwards and back, and then makes a sound.
go run ./step4/ [MAC address or Bluetooth ID]
tinygo flash -target badger2040-w -ldflags="-X main.DeviceAddress=[MAC address]" ./tutorial/step4/
Gets ready and then does a little dance.
go run ./step5/ [MAC address or Bluetooth ID]
tinygo flash -target badger2040-w -ldflags="-X main.DeviceAddress=[MAC address]" ./tutorial/step5/
Now take control of MiP and drive it around using a DS3 controller from your computer.
Plug in the DS3 controller to your computer. The controls are as follows:
- Right stick - direction
IMPORTANT NOTE: you must press the "P3" button when your program first runs for the "clone" DS3 joysticks we are using to fully turn on.
go run ./step6/ [MAC address or Bluetooth ID]