Newbie, of course -- Old, 66 two days ago -- Trying to learn, is there anything else to do at this age?
Does anyone know where I can go to get info on controlling a 2 wire multi color led, the type found in cheap solar powered lawn ornaments such as the ones sold at Harbor Freight.
Connect it to two output pins, with a current limit resistor, like 270 ohm.
A High, B Low, light one color
A Low, B High, light the other color
A & B both High or both Low, no color lit up
Thank you for the reply. However it is multicolor, about 5 or 6 different with one fading to the other. Sorry I wasn't clearer at first.
Connect it to two output pins, with a current limit resistor, like 270 ohm.
A High, B Low, light one color
A Low, B High, light the other color
A & B both High or both Low, no color lit up
Course, if you want to turn both off, will need a way to 'gate' the PWM output to achieve one of the off states.
Microcontroller does not have a way to achieve sync'ed inverse PWM that I am aware of hence the need for external hardware.
Other method is to control 2 outputs using blink without delay style programming.
Do not power it with more than 4 or 5 volts at most - through a resistor.
If you have specs on it - always the best way - follow them carefully regarding current limiting and voltage. Because the colour is changing, it does this internally using PWM and if you are driving it with too much current or too much voltage, it is quite easy to overheat them and they can have a short working life.
Some mice I bought years ago had just a current limiting resistor from 5V and burned out quickly. I replaced them with others - more a "flashing" version than "fading" - with a couple of diodes in series instead of (or was it as well as?) the resistor and they are still going - flashing.