Go Down

Topic: Testing UNO R3 (Read 894 times) previous topic - next topic

mohdrais

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.begin(9600);
  Serial.println("Starting");
  Serial.println("Sensor Test");
}

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

  Serial.print("value:");
  Serial.println(value);

  delay(1000);
}

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!
MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Go Up