LearningtocodetheESP32usingArduinoIDEandutilisingtheBluetoothfunctionalityoftheboard.
The original code worked well and displayed the Bluetooth input in the monitor. I wanted to use this input to control the LED on the ESP32 board. This should work on any ESP32 board that has Bluetooth connectivity. You may need to change the LED_BUILTIN assignment number to match your particular board.
It took me some time to work out how to do this but after research and head scratching it works and I'm very pleased.
You will need a method to connect and communicate to the ESP32. I recommend the Bluetooth Serial Manager. You will need to configure the functions buttons to output the correct data.
Long press on a function key and change the Name and Value of 3 buttons as...
[Name] Led On [Value] Led On
[Name] Led Off [Value] Led Off
[Name] Toggle [Value] Toggle
The values passed to the ESP32 are case sensitive (this could be changed in the code so that any case or a mixture of case will still function).
Serial USB Terminal - Apps on Google Play
Possible future use of the code, instead of just powering the onboard LED.
Remote control of lamps or other electrical equipment, via a low voltage relay.
Comments
Please log in or sign up to comment.