Go Down

Topic: Testing UNO R3 (Read 1 time) previous topic - next topic


Dear Sir,
I am wondering whether my UNO R3 is mulfunction. I run the sketch as follow but WITHOUT attaching any analog seasor / wire to A1. I have tried using A0, A2 and so on but the reading are almost similar. The readings are about 270. In my opinion it should be 0. The skecth is as follow:

int senPin = 1;

void setup()
  Serial.println("Sensor Test");

void loop()
  int value = analogRead(senPin);



Jack Christensen

This is normal behavior, not a malfunction. Input pins have very high impedance, and will "float" -- giving a non-zero reading that will also vary over time. Connect the pin to ground (GND) and then it should read zero.

When posting code, please use code tags for better readability. See item 7 here. Welcome to the forum!

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131