
when i send some message through my phone such as 1, i get 1201281200128120 as output in serial monitor. I want to map the values and use the values in different range to get different output, how do i solve the problem? Please help me!
Explain what the problem is, and how what you observe differs from what you expect or observe.
Meanwhile, read this
Please remember to use code tags when posting code.
Welcome to the forum
Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'
Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination
As to your question, start by using Serial.println() instead of Serial.print() so that you see each received byte on its own line. Are you sending characters or bytes ?
Running software serial at 38400 is OK for leisurely AT commands but risky in comms mode. You might reduce it to 9600. I assume you have properly set the serial monitor to 38400...
It would be easier to read if you print something between each number, like:
Data = Bluetooth.read();
Serial.print(Data);
Serial.print(", ");
Then you might get
120, 12, 81, 200, 128, 120
Looks like garbage to me. Are you sure your Bluetooth interface is set to 38400 baud?
What app are you using on the phone? Are you sending text?
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.