Question about the full color LED

Talk about YBoxen, widgets, Propeller hacking, etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
InsanePyros
 
Posts: 11
Joined: Sat Mar 14, 2009 1:48 am

Question about the full color LED

Post by InsanePyros »

How is it that the LED is able to display different levels of brightness through only three IO pins? As far as I knew the IO pins were completely binary so shouldn't the led only be able to display 7 colors plus off? I'm very new to the DIY electronics hobby so please try to explain it in simple terms or from a software standpoint only. Thanks in advance.

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Question about the full color LED

Post by adafruit »

its called PWM!
heres a kit that is dedicated to PWM'ing leds http://www.pcboard.ca/kits/led_rainbow/

InsanePyros
 
Posts: 11
Joined: Sat Mar 14, 2009 1:48 am

Re: Question about the full color LED

Post by InsanePyros »

Thanks for the answer. I am familiar with the term PWM from first robotics, but I never actually bothered to look up what it meant besides pulse with modulation. Quick wikipedia search and I now know how it works in concept, if not the exact implementation used in the code.
edit: It just dawned on me that this means anytime I want to display more than 7 colors I have to have the LED run on its own separate cog. dang. at least the subsys object is already written, handles the speaker as well, and now I have no reason not to use it.

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Question about the full color LED

Post by adafruit »

ya pretty much. with AVRs you can use the 'build in PWM' engine but for spin its just another cog

Locked
Please be positive and constructive with your questions and comments.

Return to “YBox2 (discontinued)”