Handlebar Controller (Software)
Software development steps
- Install Arduino IDE and ESP32 library from scratch
- Bluetooth Keyboard
- Rotary encoder connexion
- Configuration file with Inifile on SDCard
- Display with OLED shield
Step 1 – Install Arduino IDE and ESP32 library from scratch
S1.1 Download Arduino IDE from https://www.arduino.cc/en/software
- Install the current upstream Arduino IDE at the 1.8 level or later.
S1.2 Install “Expressif ESP32” library https://github.com/espressif/arduino-esp32
as described in https://github.com/espressif/arduino-esp32/blob/master/README.md and https://github.com/espressif/arduino-esp32/blob/master/docs/arduino-ide/boards_manager.md
- Start Arduino and open “Preferences” window.
- Copy the following link https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
- Paste the link into “Additional Board Manager URLs” field.

- Open Boards Manager from Tools > Board > Boards Manager menu
- Search “esp32″ platform
- Select “esp32” by Espressif Systems and click “Install” button



S1.3 Plug and select the device
- Plug the LOLIN D32 PRO with USB Cable
- Select the board from Tools > Board > ESP32 Arduino > LOLIN D32 PRO

- Select the usb port from Tools > Port (with Mac OS is /dev/cu.usbserial-1440)

- Open the terminal with Tools > Serial Monitor

S1.4 Compile the first sample code
- LOLIN D32 PRO Sample codes are available into File > Examples

- Select into Build-in Examples the Blink code with File > Examples > 01.Basics > Blink

- Compile the code with Sketch > Verify/Compile
- Send the code to the device with Sketch > Upload
- Or directly with following button

- In the device the blue led is blinking
Step 2 – Bluetooth Keyboard
S2.1 Install “ESP32 BLE Keyboard” https://github.com/T-vK/ESP32-BLE-Keyboard
- Download the latest release of this library from the release page https://github.com/T-vK/ESP32-BLE-Keyboard/releases.
- In the Arduino IDE go to “Sketch” -> “Include Library” -> “Add .ZIP Library…” and select the file you just downloaded.


You can now go to “File” -> “Examples” -> “ESP32 BLE Keyboard” and select any of the examples to get started.

Step 3 – Rotary encoder connexion
Step 3 – Configuration file with Inifile on SDCard
Step 4 – Display with OLED shield
ESP8266 OLED Driver SSD1306 https://github.com/ThingPulse/esp8266-oled-ssd1306
AFArray library https://github.com/TechLabCommunity/AFArray
IniFile library https://github.com/stevemarple/IniFile
SimpleRotary Arduino library https://github.com/mprograms/SimpleRotary
Recent Comments