I have this push-button switch which has two solder lugs for 12 VDC power and will illuminate red or green depending on the polarity of the wiring. It may not actually use a bi-color LED, but it seems to be a good representation for how it works. I can't find a schematic for the switch, though I expect it may be something like this:
I'm providing the 12V using an LM7812C voltage regulator but I'm struggling to figure out how I could control the polarity of the applied voltage using an Arduino. My idea is to have an Arduino control a MOSFET to switch power to the LED, though I get lost trying to find a way to flip polarity.
Is there a way I could control the LED to be red, green, or off using outputs from the Arduino?
Or alternatively, just have the switch default to one color and switch to the other when triggered by an output from the Arduino?