I went through most of the question related to internal pull ups but i couldn't find the answer. I want to use pin 0 and 1 (though they are analog input) as just digital input with pulls ups but i keep getting this error :
arduino_sketch.cpp: In function 'void setup()':
arduino_sketch:24: error: 'INPUT_PULLUP' was not declared in this scope
My setup code :
void setup()
{
pinMode(outPin, OUTPUT); // sets the digital pin as output
pinMode(rtPin,OUTPUT);
pinMode(ltPin,OUTPUT);
pinMode(enable,OUTPUT);
pinMode(upperLimit, INPUT_PULLUP); // INTERNAL pullup
pinMode(lowerLimit, INPUT_PULLUP);
Serial.begin(9600);
Serial.flush();
digitalWrite(outPin, 1); // show initilization is done
delay(100);
digitalWrite(outPin, 0);
delay(100);
digitalWrite(outPin, 1);
delay(100);
digitalWrite(outPin, 0);
delay(100);
motorEn(1);
while(digitalRead(upperLimit) || digitalRead(lowerLimit)){
motor(50); // brring it down
}
motorEn(0);
}
I am using Duemilanove. and when i write 'INPUT_PULLUP' it doesn't gets highlighted in blue like when its gets when I write 'INPUT' or 'OUTPUT'. What might be the reason?