Check if PIN is HIGH then is connected and do stuff?
Do I need external resistor (and what value) or is it sufficient the INTERNAL_PULLUP?
Can I leave the PIN shorted to GND for a massive amount of time, let's say for 1 year? This atmega will be on "forever"
pseudocode, to understand:
void setup() {
pinMode(PIN_CHECK , INPUT_PULLUP);
}
void loop() {
if ( PIN_CHECK == HIGH ) {
Serial.println("The user has placed the jumper, the pin is shorted to GND!");
}
}
If you really need to have that pin grounded, don't present an opportunity to have the jumper removed. Wrap a wire around the pins and solder it permanently.
Your grounding the pin permanently is no different than any other connection to any other Arduino pin. Should be ok for the life of the project!
Paul_KD7HB:
Why don't you just write a program to test it?
If you really need to have that pin grounded, don't present an opportunity to have the jumper removed. Wrap a wire around the pins and solder it permanently.
Your grounding the pin permanently is no different than any other connection to any other Arduino pin. Should be ok for the life of the project!
Paul
The debugger man ( ) could remove the jumper to debug the application.... So, I need really the easy to remove/insert it
sterretje:
It's as simple as using INPUT_PULLUP; no external resistor required. If the jumper is placed, the pin will read LOW.
Permanently inserted implies checking in loop if the signal is still LOW.
And yes, you can run it for years like that.
Thank you for your answer. Thank you to both! For your answer!
If you're going to do that then please be considerate enough to add links to the other places you cross posted. This will let us avoid wasting time due to duplicate effort and also help others who have the same questions and find your post to discover all the relevant information. When you post links please always use the chain links icon on the toolbar to make them clickable.
Paul_KD7HB:
I have used equipment that had a debugging option. In ALL cases it required PLACING a jumper on 2 pins, not removing one.
Paul
Interesting.... My idea is " If jumper is in position, at max 23° read from a sensor shutdown the relay". If jumper not in position, leave on for whatever temp".
But, I could invert the logic, with no problem..
pert:
Also posted at: atmega328p - Arduino/Atmega328: check if PIN is shorted to GND - Electrical Engineering Stack Exchange
If you're going to do that then please be considerate enough to add links to the other places you cross posted. This will let us avoid wasting time due to duplicate effort and also help others who have the same questions and find your post to discover all the relevant information. When you post links please always use the chain links icon on the toolbar to make them clickable.
Ok, sorry for crossposting... btw, thank you to all!
I complained about this sort of thing as crossposting in the past but a lot of the regulars responded that they think it's fine to post to this forum and other places as long as you don't post multiple times to the forum. So I think it's fine to do it as long as you add links to the crossposts. That way we can check the other post to see what's happened over there before spending a lot of time to give a duplicate answer here or asking for additional information that was already provided there. I do think that if you get an answer here before getting one on a Stack Exchange site that you should answer your own question and mark it answered over there since that is how the system works on those sites. In this case you already got an answer there and accepted it so that's not necessary.