Open cdpdyulabs opened 6 months ago
HardwareSerial MMWave(1); const byte numChars = 32; char receivedChars[numChars];
BluetoothSerial SerialBT;
void setup() { Serial.begin(115200); MMWave.begin(115200, SERIAL_8N1, 16, 17); SerialBT.begin("ESP32-Bluetooth-Logger"); }
void loop() { static byte index = 0;
while (MMWave.available() > 0) { char rc = MMWave.read(); if (rc == '\n') { receivedChars[index] = '\0'; Serial.println(receivedChars); SerialBT.println(receivedChars); index = 0; } else if (rc != '\r') { if (index < numChars - 1) { receivedChars[index++] = rc; } } }
}
include
HardwareSerial MMWave(1); const byte numChars = 32; char receivedChars[numChars];
BluetoothSerial SerialBT;
void setup() { Serial.begin(115200); MMWave.begin(115200, SERIAL_8N1, 16, 17); SerialBT.begin("ESP32-Bluetooth-Logger"); }
void loop() { static byte index = 0;
}