Firmware for all wheel drive bobby car with four hoverboard motors and two hoverboard motorcontrollers. The hoverboard mainboards are controlled via ADC (XBox 360 triggers with potis) and UART through an esp32 microcontroller. The esp32 is connected via SPI to an 3.5 inch touch screen (ILI9488) with an XPT2046 touch controller.
====
All Pin assignments can be changed in motorcontroller/platformio.ini and hoverboard-mainboard/main.cpp
The touchscreen is wired to the GPIO pins of the esp32 as follows:
SDO(MISO): Pin 19
SDI(MOSI): Pin 23
SCLK: Pin 18
CS: Pin 5
DC/RS: Pin 17
RESET: Pin 16
T_CS: Pin 4
T_CLK is wired parallel to SCLK, T_DO parallel to SDI(MOSI), and T_DIN parallel to SDO(MISO). VCC and LED are connected to 3.3V - 5V of a voltage converter and GND to the ground of the esp32.
The two hoverboard motorcontrollers are connected to the esp32 as follows:
Front controller:
Right sensor cables: The black (GND) cable goes to GND, the blue (TX) to Pin 13, and the green (RX) to Pin 12
Rear controller:
Right sensor cables: The black (GND) cable goes to GND, the blue (TX) to Pin 35, and the green (RX) to Pin 34
Build and flash the esp32 firmware:
cd microcontroler
platformio run -t upload
OTA flashing is also supported by adding --upload-port=IP as option where IP is the ip adress of the esp32.
Build and flash hoverboard controllers:
cd hoverboard-mainboard
make flash
For more details about flashing the motorcontrollers the first time see the README.md in the hoverboard-mainboard directory.

