make a pin high from another pin

Hello,

im using 2 shields where some of the pins interfere with eachother. lets say pin 13 is used by both shields. Is it possible to disconnect pin 13 on the "upper shield" and set the pin HIGH or LOW through another pin via a cable ?

pinMode(13, OUTPUT);
pinMode(5, OUTPUT);

digitalWrite(5, HIGH);

using the code above: Will pin 13 be "HIGH" if pin 5 and 13 is connected with eachother?

T
hanks in advance!

Connecting output pins together means they will fight if set to different states and burn each other out.

Perhaps you are looking for open-drain operation? Add a pull-up resistor, make both pins INPUTs (not INPUT_PULLUP). Then you can have them connected - setting either pin as an OUTPUT will pull both low,
the pull-up pulls it high if neither is set to OUTPUT.

glony:
Hello,

im using 2 shields where some of the pins interfere with eachother. lets say pin 13 is used by both shields. Is it possible to disconnect pin 13 on the "upper shield" and set the pin HIGH or LOW through another pin via a cable ?

pinMode(13, OUTPUT);

pinMode(5, OUTPUT);

digitalWrite(5, HIGH);




using the code above: Will pin 13 be "HIGH" if pin 5 and 13 is connected with eachother?

T
hanks in advance!

Yes, of course. The signals follow any wiring changes you make. In your example, pin 13 on the shield that you have modified, will be affected by activities on pin 5 on the board, provided you have installed a jumper there.

However, you have to ensure that pin 5 isn't used by the other shield.

If both pins are outputs and are linked physically and you make one high and the other is low then you get smoke or at least a damaged Arduino.

Suppose you have opened the pin 13 between shield #1 and shield #2. You run a jumper from the Arduino pin 5 to pin 13 of shield #2. That much is okay, you can now address it by changing the software. But pin 5 must not be connected to anything on shield #1.

Thanks for answers guys, I know how to solve this now!