input pin

Hi all,
Been a while since a played around on Arduino and so I feel like a total noob :slight_smile:
So as you can gather I am in need of desperate help. I want to know when a input button is LOW and you
have a external resistor(20kohm) keeping it high from 5 volt, if any damage would happen when I digitalWrite it High? Sounds stupid to me asking this because I dont think it would, but on the other hand I
would rather be safe than stupid :smiley:

I want to know when a input button is LOW and you
have a external resistor(20kohm) keeping it high from 5 volt, if any damage would happen when I digitalWrite it High?

Why would you be writing to an INPUT pin?

To turn on the built-in pull up resistor?

AWOL:
To turn on the built-in pull up resistor?

Normally, yes. But doing that while there is an external pullup resistor doesn't seem like a useful thing to do.

Hi, thanks for taking the time to chat to me. It is only because I am trying to manipulate the code to achieve a certain action. So now it is doing what it is suppose to do , but I dont know if it is a wise thing to do.

but I dont know if it is a wise thing to do.

Nor do we, since you have not said what you are trying to do, nor have you explained how you are doing it.

So as you can gather I am in need of desperate help. I want to know when a input button is LOW and you have a external resistor(20kohm) keeping it high from 5 volt, if any damage would happen when I digitalWrite it High?

If your button is connected to GND and it is a NC (normally closed type) and you have an external pullup resistor (20K) connected to 5 volts with the other end of the resistor connected to the input and NC terminal of the button, then if you use pinMode(pin, OUTPUT) then use digitalWrite(pin, HIGH) it will damage your I/O pin.

If your button is connected to GND and it is a NO (normally open type) and you have an external pullup resistor (20K) connected to 5 volts with the other end of the resistor connected to the input and NO terminal of the button, then if you use pinMode(pin, OUTPUT) then use digitalWrite(pin, HIGH), it will not damage your I/O pin if you press the pushbutton. Howerver, if you use digitalWrite(pin, LOW), it will damage your I/O pin if you press the pushbutton.