void setup(){
Serial.begin(9600);
pinMode(supfanled, OUTPUT); // supply fan led o/p
digitalWrite(supfanled, HIGH); // turn on pullup resistors
hi
just stumbled upon internal pull up r's, is this the correct place (setup) to define the internal pull up r's?
thank you
system
April 19, 2012, 7:38pm
2
Set your pin mode to input instead of output and then you're on your way.
I know it looks wrong to be writing to a pin set to INPUT mode, but that's just how the arduino works for turning on the resistors.
void setup(){
Serial.begin(9600);
pinMode(supfanled, INPUT); // supply fan led o/p
digitalWrite(supfanled, HIGH); // turn on pullup resistors
}
thank you, ive got it amazing, internal r's
@jonisonvespa : Are you using Ardunio IDE 1.0?
Try using:
pinMode(n, INPUT_PULLUP);
where n is your pin number.
system
April 20, 2012, 8:14am
6
Try using:
pinMode(n, INPUT_PULLUP);
What version of the IDE is that?
Release candidate 2 (-rc2). I think release candidate 1 has it as well.
What's INPUT_PULLUP when it's at home? Wouldn't PULLUP be better?
MarkT
April 20, 2012, 10:05am
9
RandallR:
Try using:
pinMode(n, INPUT_PULLUP);
where n is your pin number.
Its counter-productive to suggest something that cannot work for the current major release.
pinMode(fan1, INPUT_PULLUP);
tyred that but got, was not declared at this scope, im using arduino 1.0
system
April 20, 2012, 12:31pm
11
It isn't released yet, which is why posting it was counter-productive.
Just use the pinMode (x, INPUT)/digitalWrite(x, HIGH) method.
Sorry for the confusion. I am still rather new to this and I just learned about the INPUT_PULLUP parameter. I had not used very many previous versions of the IDE so I did not know it was so new.
Did not mean to cause any problems.
BTW: RC2 is working great for me.