I am trying to use my Heltec Wifi Kit 32 as a Bluetooth to serial bridge, and it works with the following code:
Code: Select all
#include "BluetoothSerial.h"
#include <HardwareSerial.h>
BluetoothSerial SerialBT;
HardwareSerial MySerial(2);
void setup() {
MySerial.begin(9600, SERIAL_8N1, 16, 17);
SerialBT.begin("wConsole");
delay(4000);
}
void loop() {
if (MySerial.available() > 0) {
SerialBT.write(MySerial.read());
}
if (SerialBT.available() > 0) {
MySerial.write(SerialBT.read());
}
delay(25);
}
Am I missing something in code to make this work?
Thanks