MEGA Pin 20&21

Hi all.

I want to use pin 20 and 21 of an arduino mega board as interrupts. i figured out, that if these pins are set as input-pins, that they are set to high impedance, so there is 5V on these pins... since i use the mega to interface with another allready existing hardware, this is not suitable for me ... the hardware gives me 5V not drains it...

i tried to make a digitalWrite(20, LOW) after attaching the interrupt to this pin, but this does not change anything... seems i cannot choose on these pins...

so is it, and if how, possible to set these pins LOW at input-mode? thanks! inx

are set to high impedance, so there is 5V on these pins

No, that is a misconception: They are "undefined".

digitalWrite(20, LOW), but this does not change anything.

It shouldn't , as this is the default setting.

to set these pins LOW at input-mode

This is a somewhat senseless question, as when you are in input mode, it's YOU who has to provide the input....

You might use an pull-up (a high-valued resistor to ground), but that all depends on your true input...

sorry deSilva An pull up resistor is not to ground but to +5V Uwe

Is it so? Oh, dear, oh dear...