![]() After a moment the device "HC06" will appear, for example - see the image in this step. Well program the ESP32 using Arduino IDE, so make sure you have the ESP32 add-on installed before proceeding. To do this, enter the Bluetooth menu inside Settings, then search for new devices. Once the app has been installed, you will need to pair your Bluetooth module to the smartphone. We used " Bluetooth Terminal" by qwerty as it was free and worked, however you can choose your own. ![]() ![]() In our demonstration we'll use terminal emulation software on the Android smartphone. You can see how simple it is for the Arduino to take action based on the character received - but where does this text come from? As ESP32 Bluetooth is configured follow the steps to connect ESP32 Bluetooth with PC. This is then interrogated using the if functions starting from line 23. This is because your Bluetooth module will be connected to both the RX and the TX pins of your Arduino and. The sketch waits for a character of text to be sent from the Bluetooth module to the software serial port, and this is stored in the variable char a at line 22. HC-06 Bluetooth Transceiver Module (SLAVE). You can see in line two of the sketch that the software serial port has been defined with the name "BT", and that any references to the module for serial communication in the sketch are now BT.begin, BT.println and so on. This function takes no argument, and it returns the six bytes Bluetooth address as a string that you can print to the serial. The sketch is quite simple, it uses a software serial port to communicate with the Bluetooth module in the same way that you would normally do so with normal Arduino serial port. BluetoothSerial. Once you have connected the hardware, enter the sketch below into the Arduino IDE and upload it to your board.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |