Hi, I have a problem that I can't figure out. I have an arduino uno with a hc-06 bluetooth module connected to the pins 0 and 1 (rx and tx). Rx--arduino Tx. Tx--arduino Rx. Gnd--Gnd. +5v--+5v
The function of my code is to receive Bt signals (in letters) from an app on my phone and print them the serial monitor. it has worked before but this time I tried it several times and the only result is some queer blocks in the serial monitor. Sometimes these blocks would stop when I sent the first signal from my phone, but it still didn't print the letter. Here is the code I am using.`
char val;
void setup() {
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
while (Serial.available()>0);
{
char val = Serial.read();
Serial.println(val);
}
}
To start with, Arduino Uno TX and RX are used also for the Serial Monitor, so you have a problem. Perhaps you misremember, and your HC05 module was attached to other pins on the Uno, and software Serial was used to talk to the HC05, while Serial was used to talk to Serial Monitor?
Thank you very much! I am a beginner at programming and I was really stuck. I tried what you said and it worded perfectly. May God bless you and thanks again!