2

I've got - for example - pin 1, which has a current in (and therefore set as an input in the setup) and pin 2, which has to be routed to pin 1 (and therefore has pin 1's current out - which may NOT be the same as using Arduino's built in current out - and is set as an output in the setup).

Then, during the loop I need these two pin to be detached from each other (so that the current will still flow into pin 1 but won't flow out of pin 2) while two servos will move.

For example I supposed something like:

digitalWrite(secondpinPin, LOW);
myservo1.write(90);
myservo2.write(90);
digitalWrite(secondpinPin, HIGH);

But I don't know how to make them routed to each other for the rest of the time.

Thanks in advance!

dda
  • 6,030
  • 2
  • 25
  • 34

1 Answers1

0

So you're saying that pin1 can receive current from two source: pin2 and external circuit ?
My answer is: Add a pull down resistor to pin1, that's a 10k resistor connected from pin1 to ground.

Wadaane
  • 326
  • 2
  • 15
  • nope, actually I meant that I needed arduino to act as a virtual switch between those two pins, so pin 2 will receive current only from pin 1. but nevermind, meanwhile I choose to use a relay controlled by an arduino pin ;-) thanks anyways! – Luca Smith Rainoldi Jun 13 '17 at 08:29
  • Oh yeah, I get it, I tried that once, and me too I choosed to go with the relay. :D – Wadaane Jun 13 '17 at 09:58