Bluetooth Controller

You will be connecting a game controller to your ESP32 for controlling your robot (i.e. triggering autonomous modes, moving between challenges, and firing your launching mechanism)

That being said, you will not be allowed to manually drive your robot through the challenges, as that defeats the purpose of having the sensors.

It is highly recommended that you program specific functions of the sensors (line, color, distance) to specific buttons on the remote controller so that you have more control over your robot’s behavior (i.e. press A -> color autonomy mode, press B -> exit to normal drive mode).

Connecting the Controller

See BluePad32’s official docs if you’d like to see other features.

First you will need to find out what your controller’s Bluetooth address is.

  1. Plug in your ESP32 and flash it with the starter code
  2. Open the serial monitor
  3. You should see this in the serial monitor while trying to connect your controller (press and hold power button on controller until lights slowly and then rapidly move): controller_address :( The string of octets (something like 98:B6:E1:7C:C3:95) is your controller’s Bluetooth address

  4. Try adding your controller’s Bluetooth address through the serial terminal: add_bluetooth.png :(

  5. Controller should connect automatically, and the controller data should begin streaming in the serial monitor

Using the Controller

  • BP32.update()
  • for loop in loop()
    • todo: actually figure out how the iterator works and make it something more standard to be understandable by anyone
  • accessing controller data