Control LED

I cannot for the life of me figure out how to control a LED from Robot C. I have done it in EasyC.

I have the LED hooked up to a extension positive to red and negative to black. All the LED does is stay on. Am I doing this correctly?

Been a while since I posted! :slight_smile:

Thanks,
Kyle

Quazer answered:

[INDENT]**Hey Kyle,

If you are hooking the LED to red(+) and black(-) then it will be constantly powered, as you are seeing. The control signal is the white wire, so you need to wire the LED from white-to-red or from white-to-black (observing correct polarity, of course).

If you wire it white-to-red, then you’ll have to write a ‘0’ to the port to turn the LED on. If you wire it white-to-black, then a ‘1’ will turn it on.

If this is a high power LED, then you might need to add a transistor to get any significant brightness. The control signal (white) can only drive around 4 or 5 mA.

Cheers,

  • Dean**[/INDENT]

This works great! Thanks Dean!