Pages: [1]   Go Down
Author Topic: Testing UNO R3  (Read 854 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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);
}
Logged

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 95
Posts: 4092
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Pages: [1]   Go Up
Jump to: