Go Down

Topic: Input is Always HIGH (Read 411 times) previous topic - next topic

Mar 23, 2012, 10:20 pm Last Edit: Mar 23, 2012, 10:25 pm by emiravci27 Reason: 1
I bought my Arduino 2 days ago .
I connected my Arduino TMP36 but it isn't stable and when I removed it analog reads something bigger than zero.

Now , I'm trying my change with digitalRead but this isn't work neither.

Code: [Select]


int ledPin = 13;


void setup()
{
 Serial.begin(9600);
 pinMode(ledPin,OUTPUT);
 pinMode(8,OUTPUT);
 pinMode(10,INPUT);
}

void loop()
{
 digitalWrite(10,LOW);
 digitalWrite(8,HIGH);
 if(digitalRead(10) == HIGH)
 {
   Serial.println("hey!");
 }
}


When ever something touch (even nothing connected cable) 10th pin it writes "hey!" I just confused.

Sorry about my english.


--

Things going even stranger when something approach 8-9-10 th pins its alert  :smiley-eek:

AWOL

Without a pull up, the pin is floating.
You turn off the pull up every time through loop().
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Go Up