Hi,
I got my first Arduino. It's nano clone.
I needed to change bootloader to old one.
When i upload example 'digitalreadseries' and nothing is connected to Arduino in series monitor i should only received zeros, right?
I only receive reversed question marks. My baud is in both code and monitor set to 9600. I also tried other values but it never helps.
//-Blink example works fine.
-Fade example turn off and on my build in led but don't fade it.
-analogreadseries works like digitalreadseries
button example without any cable wired to Arduino lights up build in led constantly
What should I check?
Wrong. Nothing connected to a pin means it is floating and can read anything due to it picking up interference.
Never never post code as a picture it is one of the most useless things you can do.
You should check the section you posted in. Installation and troubleshooting is NOT for asking questions about your project. If the blink example works then it is the wrong section.
I have moved it to a better place.
As @Grumpy_Mike mentioned, because you have nothing connected to pin 2 then its value is not defined.
If you declare the pin as...
pinMode(pushButton, INPUT_PULLUP);
then it will be HIGH by default, and you should use the push button to pull it to GROUND.
Also...
delay(1);
isn't enough of a delay to stop the monitor from being flooded with output... try
delay(100); // 0.1 second
Also, if you ever post code make sure you use code tags (this button in the editor </>)... it is much easier for anyone to then debug.
1 Like
system
Closed
August 4, 2022, 5:27am
5
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.