Hello, i'm a noob trying to play around with arduino uno, for a few days now. I'm getting a weird behaviour from arduino! Whenever i open the serial monitor and try to print out any character, a weird behavior happens: some characters appear repeated in the serial monitor in the first print, then it prints out the characters normally. I noticed that this behavior happens when I close the serial monitor and open it again. Sometimes it prints out the repeated character immediately... sometimes after waiting a few seconds and opening the serial monitor again...
Do you guys know what's happening?
As you can see below, the code is basically just a println! I have the serial baud rate at 9600. I tried to increase/decrease the delay, and i also tried to add a delay in the setup(){}, but nothing really helps.
I’m not sure the answer here , but if you get it to print a series of numbers you can see if it’s printing the same number twice or just missing the line feed .
You can also try changing the serial monitor settings ( new line etc) in the bottom right hand corner .
I would suspect it might be something to do with part of sending A is left in the print buffer when you switch the serial monitor off or a setting on the monitor . It’s just missing the return , not print “ twice”
Someone with better knowledge than me might know the answer ??? As a “fix” try printing a blank “” in setup - few things to try there for you to work out what is happening .
Hi, thanks for the help, hammy. However, I'm still having the same problem. I've tried to print out a blank "" in the setup function as a fix but the problem persists. Oh, i've also tried to play around with the serial monitor settings but the result hasn't chaged.
When trying to println anything in the setup function i realized that the "a" character is being printed at the exact same time as the one that is being printed inside the setup function.
How is this even possible? The "println" inside the loop is printing at the exact same time as the "println" inside the Setup function!
I'm stuck! something so simple yet so difficult! I need miraculous help!
I've uploaded 2 links below with images so you can see what's happening in the serial monitor (please, see the images so you can vizualize what's going on).
Hi, jremington! So what should i do now? i've read something about it but i can't figure out how to fix the reboot "problem". I've seen a lot of arduino's Uno and none of them had this problem. What would you suggest me now?
You can connect and use a serial terminal program instead of the serial monitor. That won't cause the reboot. I use PuTTY or TeraTerm on Windows, GTKterm on linux.
Please post images in posts, not on some image hosting side; it's so easy, just take an image / screenshot and paste it in the forum's edit 'window'.
Further it is in general far preferred that you just copy-and-paste the text of the serial monitor in a post (using code tags).
That might depend on the TTL-to-USB chip on those Unos. Are they all exactly the same? I have not been able to reproduce your problem with three different TTL-to-USB adapters (16U2, FTDI232, CH340) but I have seen it before.
Do you really care?
You can analyse the cause of the problem by modifying your sketch to something like
If you see the below, the problem is the buffering at the PC side.
aHello World
a
a
a
Anything before the 'Hello World' is a leftover in the serial buffer on the PC. Don't forget that the Uno keeps sending data if you close the serial monitor. Only when you open the serial monitor and the board is reset it will stop sending (and based on the sketch start again).
You see 'aa'; the first 'a' is from the serial buffer on the PC. The reset happened before the LF> was send hence the second 'a' on the same line.
So in the real world, you would wait for a KNOWN message in the serial monitor before actually start communicating with the Arduino.