Bluetooth connection esp32.
This commit is contained in:
parent
1fb0a6a7dc
commit
425df109ca
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue