Is external resistor needed for making D0 go HIGH

Hi
Probably a stupid question but I can’t seem to get it to work.

Do I need a external resistor when I connect D0 to ground which should make it to go HIGH? Docs state that it already has one. Can’t get it to work connecting it to ground.
Boron v2.20
Using
int pin = D0;

loop() {
pinmode(pin, INPUT_PULLDOWN);
Particle.publish(“Pin”, String(digitalRead(pin));
}
then physically wire pin D0 to ground. Always returns 0. Any ideas!

Thanks
5310

Your pull is backwards. If you are connecting to GND, then you need INPUT_PULLUP to pull the pin in the opposite direction when there is no connection.

And you probably want to set the pinMode in setup(), not loop() before reading it.

1 Like

Thanks. Stupid mistake,

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.