I have a simple script that listens on pin 0 for input, and if it gets anything, it Serial.prints it. But I cannot make sense of the results. I have a basic app that sends text over Bluetooth (in the code I see utf8.encode(message) if that helps), and I'm able to validate that the message is not corrupted by the module, by simply touching the RX and TX pins together, the app receives the same message it sent. But the Arduino cannot understand it.
Here's my code:
void setup() { Serial.begin(9600); } void loop() { if (Serial.available() > 0) { Serial.print("New value: "); Serial.println(Serial.read()); } } The TX on the HC-01 is connected to pin 0, and the RX is connected to pin 1. Power and ground are connected to the Arduino's (and I even tried different grounds just in case that one was fried). The Arduino is powered by USB and I'm using the Serial moniter. Here is some sample input-output:
Me through the app: a. Arduino: 255 Me through the app: a. Arduino: 254 Me through the app: a. Arduino: 254 Me through the app: a. Arduino: 254 Me through the app: a. Arduino: 254 Me through the app: a. Arduino: 255 Me through the app: aa. Arduino: 254 Me through the app: aaa. Arduino: 252 Me through the app: aaaa. Arduino: 252 I just don't understand any of it. Please help me out.