I am using an ESP32 and would like the device to receive a number. I have sent the number 32.44 to the device but when I output it to the serial monitor it is not correct. What am I doing wrong?
The serial monitor output is:
16:05:56.837 -> 51.00
16:05:56.837 -> 50.00
16:05:56.837 -> 46.00
16:05:56.837 -> 52.00
16:05:56.837 -> 52.00
16:05:56.837 -> 13.00
Here is the code:
#include "BluetoothSerial.h"
BluetoothSerial SerialBT;
double count = 0;
void setup() {
Serial.begin(115200);
if(!SerialBT.begin("ESP32")){
Serial.println("An error occurred initializing Bluetooth");
}
}
void loop() {
while(SerialBT.available()){
count = SerialBT.read();
Serial.print(count);
Serial.println();
}
delay(50);
}