This week, I worked with Anthony Fletcher to connect an ESP32C3 to an iPhone via Bluetooth and implement a simple counter with a button.
The ESP32C3 microcontroller used for this project.
To get started, we had to download the NimBLEDevice library in the Arduino IDE. We also installed an app called BLE Scanner on our phones. Fletcher and I each wrote code to implement the counter functionality.
Above is my code. Unfortunately, it didn't work, and I struggled to debug it.
Above is Anthony's code, which did work. Initially, we had trouble finding the device because so many popped up in the BLE Scanner app. We resolved this by renaming the device in the code, making it easier to locate.
The BLE Scanner app we used to connect to the ESP32C3 device.
Learning to use Bluetooth on the ESP32C3 for networking was a challenge. While my code didn't work, I gained valuable insights into debugging and how Bluetooth Low Energy (BLE) works. I'm especially grateful to Anthony Fletcher for his help in making this project a success!