Hi
I'm trying to work with BlueTooth serial data.
[The code] int inByte = Bluetooth.read ();
But I only receive the format:
49 = 1
97 = a
I want 1 = 1, a = a
Is there an easy and easy way to reverse this
Hi
I'm trying to work with BlueTooth serial data.
[The code] int inByte = Bluetooth.read ();
But I only receive the format:
49 = 1
97 = a
I want 1 = 1, a = a
Is there an easy and easy way to reverse this
You are receiving ASCII. To convert ASCII numbers to integers, subtract '0' or 48, but a isn't really a number, so it already equals a...
char inByte = Bluetooth.read ();
Cast the int to a char.
char inChar = (char)Bluetooth.read ();
Have a look at the examples in Serial Input Basics - simple reliable ways to receive data.
...R