Go Down

Topic: make a pin high from another pin (Read 725 times) previous topic - next topic

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 ?

Code: [Select]
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!

MarkT

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.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

aarg

#2
May 09, 2016, 01:54 am Last Edit: May 09, 2016, 01:54 am by aarg
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 ?

Code: [Select]
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.
  ... with a transistor and a large sum of money to spend ...
Please don't PM me with technical questions. Post them in the forum.

Grumpy_Mike

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.

aarg

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.
  ... with a transistor and a large sum of money to spend ...
Please don't PM me with technical questions. Post them in the forum.

glony

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

Go Up