Is my board having an issue ?

Hi,

This is my first post on this forum, my name is Greg and I've just received my Arduino Uno a few days ago. I've been playing all day with it, and I love it, it reminds me of my old course of electronic back in the days...

I have an issue: I've done the Digital Read Serial tutorial (http://arduino.cc/en/Tutorial/DigitalReadSerial) on the port 2, and I always got the value going randomly from 0 to 1. I've checked my circuit, it seems all good. So I've checked with different ports, and this is working well with port 4, 5, 6 and 7. Also, could you please tell me if there is a physical issue with the board or if you see any reason for me having this issue ? :sweat_smile:

:) Many thanks in advance for your help !! :)

I'm assuming this is a floating pin. The behaviour you describe is perfectly normal.

The page you linked to says this, which pretty-much explains what you are seeing (as AWOL said):

If you disconnect the digital i/o pin from everything, the LED may blink erratically. This is because the input is "floating" - that is, it doesn't have a solid connection to voltage or ground, and it will randomly return either HIGH or LOW. That's why you need a pull-down resistor in the circuit.

Thank you for your replies, I will make some more tests to see if I can understand how to fix this. Also, does it explain why it's working for the other ports ?

Undefined behaviour does not work in a defined way, that is why.