Yeah, sometimes the signals you can handle with Arduino (or others MCU) are not enough. But if you are using a bicolor led to see two different states of your system, you can play the following hack.
There are two kinds of bicolor leds, the first one has the two leds in opposite directions, the second one has the two leds in the same directions.
Two leds in opposite directions.
Instead of connecting the LED between the control pin and V+ or ground, connect it to a voltage divider between the two. Raise the control voltage to V+ and the green LED will conduct through R2.
Lower the control voltage to 0V and the red LED will conduct through R1.
Two leds in the same directions.
This case is simpler, just add a HCMOS inverter as shown below
It's really simple and you can gain some pins of your MCU.
But in the last case you lose the capability to fire both color together, in the first case you don't have this capability.
Gg1.
There are problems with both of these suggestions.
For the 2-pin LED, using a two-resistor voltage divider across VCC for the other end of the LED wastes power. Normally you want to run the LED at a few milliamps at least, for reasonable brightness, so the resistor values need to be quite low, so the wasted power could be significant. Also, if VCC is 3.3V or less, there may not be enough voltage to illuminate the LEDs, since only half of VCC is available for each LED element.
One way around the first problem would be to generate a half-VCC rail using an op-amp or a TLE2426. The rail could be shared by several LEDs. Each one would need a separate series resistor. This still requires VCC to be more than 3.3V though.
I would also check the architecture of the microcontroller I/O pins. There may be an input buffer that is permanently enabled, which may enter its linear region and draw excessive current when driven (weakly) with VCC/2 when the output is tri-stated.
For the 3-pin bicolour LED, the proposed circuit won’t work because the external inverter is always enabled. The green LED will tend to pull the microcontroller pin low, and the inverter will drive its output high and activate the red LED. So it would be impossible to turn the LED off.