Maybe is a stupid question, ask so because I tested many times, the sketch works well when declared the digit pin only.
for example:
inside void setup:
pinMode(12, INPUT);
digitalWrite(12, HIGH); or what else?
how can know set pin12 HIGH or LOW? if pin12 used for RC receiver signal in?
should I do:
pinMode(A2, INPUT);
digitalWrite(A2, HIGH);
if A2 used for a analog signal input?
Are the pins be used must be declared or better declared?
Thanks
LarryD
2
To read a voltage on an analog pin you ‘do not’ need to use pinMode.
LarryD
3
pinMode(12, INPUT); // set pin as a digital input pin.
digitalWrite(12, HIGH); // this turns on the internal pull-up resistor on pin 12.
The above two lines are the same as:
pinMode(12, INPUT_PULLUP);
larryd:
pinMode(12, INPUT); // set pin as a digital input pin.
digitalWrite(12, HIGH); // this turns on the internal pull-up resistor on pin 12.
The above two lines are the same as:
pinMode(12, INPUT_PULLUP);
Thank you,
the pin used as input for RC signal, should be set HIGH or LOW?
LarryD
5
“the pin used as input for RC signal, ”
Please explain this more.
Perhaps you are looking to read a pin from an RC output. In this case I think you would use -
pinMode(12, INPUT);
digitalRead(12);