Bluetooth connection esp32.

This commit is contained in:
Vojtěch Pour 2022-11-16 17:18:17 +01:00
parent 1fb0a6a7dc
commit 425df109ca

View file

@ -92,11 +92,6 @@ String sendData="Hi from esp32!\n";
void loop() {
if(! SerialBT.isClosed() && SerialBT.connected()) {
if( SerialBT.write((const uint8_t*) sendData.c_str(),sendData.length()) != sendData.length()) {
Serial.println("tx: error");
} else {
Serial.printf("tx: %s",sendData.c_str());
}
if(SerialBT.available()) {
Serial.print("rx: ");
while(SerialBT.available()) {
@ -111,4 +106,4 @@ void loop() {
Serial.println("not connected");
}
delay(1000);
}
}