Hey guys,
So, this may be a stupid question, but at 6am, I want a second opinion, LOL...
I'm working on a project where I've got three lines available to a control panel that needs to read multiple buttons, as well as light a bi-color LED in either of the two colors (it never needs to be off, FWIW).
I've got a handle on the buttons, I'm going to do the analog "multiplex" thing with appropriately selected resistors so that I can just feed V+ in from the Arduino, then the switches will connect their respective resistors between V+ and an analog input.
So that ties up two pins, one with V+, and one for the input. I think I have a way to get the LED working with the remaining pin, but just want to make sure I'm not doing something stupid.
My theory is (being 6am and half-functioning, I'll gloss over the current-limiting resistors for now, and come back to the math once I'm sure the basic concept is valid) that I can use +3V as the supply voltage for the control panel, and then the LED will go between the 3V and a digital output.
If I set the output low, then the LED will see the +3V relative to the low output's ground, and light up green.
If I set the output high (ie, +5V), then the LED sees the +3V relative to the high output's +5V, for a potential of -2V compared to the low state, and would light up red.
Will this work, or am I missing something really stupid in my overtired state?
Thanks in advance,
Andy