While developing with the NANO board, I found that I could not get the correct output in the serial port monitoring. To prevent problems with the code, I simply added the output to the sample blink code and monitored it, but the output was still garbled and the baud rate remained the same for both. I am a new student of Arduino development, hope I can get your help, thanks!
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(9600);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
Serial.print(1);
delay(100); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(100); // wait for a second
Serial.print(2);
}
What baud rate is the serial monitor set to?
Upload the sketch again. Double check.
Thanks for your reply. I have upload this sketch many times. But the output is always garbled. I don't have any idea about this.
I tested it here, it works. So you need to go back and verify everything.
@anonymewang
Your topic was moved to its current location as it is more suitable.
Could you also take a few moments to Learn How To Use The Forum.
It will help you get the best out of the forum in the future.
Thank you
Thank you very much for your help, I will continue to check it out
We forgot to ask, what IDE are you using? Is this hardware or Arduino simulation?
I use the Arduino 1.8.19 and the board is Arduino nano.
The only small difference in my test, I used an Uno not Nano.
To me, it seems like it's running some previous sketch. To make sure, upload it again, but using a different delay value. Check to see that the LED blinks at a new, different rate.
I have tried testing with different blink times and different baud rates, but according to the blinking of the led, the program should be uploaded properly, but the output still looks like this
Then, you really haven't set the baud rate correctly. Can you post a screen shot that includes the serial monitor baud rate setting?
Also, you need to mention, in advance, any testing that you have done so we don't waste time suggesting things you have already tried.
Thank you for your suggestion, sorry for forgetting to mention these tests that have been conducted
Is anything else connected to the Nano?
No, for testing I removed all other connections
What happens when you upload a serial example sketch, from the examples menu of the IDE?
The Nano is resting on a non-conductive surface, right?
The upload shows everything is fine. Yes, the nano does not prevent on the conductive plane. Sorry I have reached the reply limit. I can find another computer or nano, but the must wait a few hours. This is original nano
Please be more specific. More detail.