but the problem is when I assign serial.read to a variable and print it on the serial
it shows one by one digit every time
I think there is any programming issue
please help!!!
more details are below with code and screenshots
#include "BluetoothSerial.h"
#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
#endif
BluetoothSerial SerialBT;
char tc;
void setup() {
Serial.begin(9600);
SerialBT.begin("ESP32test"); //Bluetooth device name
Serial.println("The device started, now you can pair it with bluetooth!");
}
void loop() {
if (SerialBT.available()) {
tc = (SerialBT.read());
}
Serial.print("TC entered =");
Serial.println(tc);
delay(1000);
}
.
.
.
The BELOW image is of the Bluetooth serial (where I enter data.)
.
.
#include "BluetoothSerial.h"
#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
#endif
BluetoothSerial SerialBT;
char tc;
void setup() {
Serial.begin(9600);
SerialBT.begin("ESP32test"); //Bluetooth device name
Serial.println("The device started, now you can pair it with bluetooth!");
}
void loop() {
if (SerialBT.available()) {
tc = (SerialBT.read());
Serial.print("TC entered =");
Serial.println(tc);
}
}