HI I have built a little USB Midi Controller for a piece of software I use. I'd like the controller to control a 2nd computer running the same software as a backup machine. Both Micro's will be usb powered from different computers. My plan was to wire the buttons of the controller to both Ardunios Micros. Is the right approach? As long as I am only connecting digital pins to ground will this work or will the 2 micro's interfeer with each other?
With a common ground, one switch can be wired to multiple inputs without regard to whether they are on the same microprocessor or even connecting to another logic input.
But mind the software. Make sure all places you connect the switch so they can be grounded are defined as inputs in your setup() function(s).
Obvsly, I hope, if you use pull-up or pull-down resistors, there should be but one or at the very least they must all be pulling in the same direction.
I'm going to read your post again to see why you need to do this if you said.
HTH
a7
Yes, and in particular, it's hard to make this work if both microcontrollers are not powered. If only one is powered, the pull up/down circuit can be disturbed by the microcontroller that is powered down.
Use two optocouplers to electrically decouple the two systems.
I havent tried this but it seems that
if both inputs are configured as input-pullup silicon diodes could be used to prevent such disturbance?
For a 32U4 running from 5V VIL is 1V so the 0.7V drop across the diode would not change the logic level.
Yes, that has been done before.
One will do.
Use the button on the first Arduino, between pin and ground.
Use internal pull up on the pin in setup, with pinMode.
pinMode(buttonPin, INPUT_PULLUP);
Connect the opto LED (with ~470 ohm series resistor) between 5volt and pin.
Also use internal pull up on a pin of the second Arduino.
Connect the opto transistor between pin and ground.
Leo..
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.