# LED Question

**URL:** <https://community.sparkfun.com/t/led-question/23503>\
**Category:** Arduino\
**Created:** [March 3, 2012, 5:56am UTC](https://community.sparkfun.com/t/led-question/23503 "2012-03-03T05:56:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![6Maverick6](https://avatars.discourse-cdn.com/v4/letter/6/e9c0ed/32.png) [@6Maverick6](https://community.sparkfun.com/u/6Maverick6)\
**Post date:** [March 3, 2012, 5:56am UTC](https://community.sparkfun.com/t/led-question/23503/1 "2012-03-03T05:56:27Z")

</div>

Hi All,

I am working on some christmas lights cause they have some good prizes every year in my area.

Anyway im going to be running LED’s across my roof (RGB) and I got some cheap ones from EBAY.

[http://www.ebay.com.au/itm/20PCS-x-4-PI … 731wt\_1163](http://www.ebay.com.au/itm/20PCS-x-4-PIN-5mm-Common-Anode-RGB-Red-Green-Blue-LED-/120868993664?pt=LH_DefaultDomain_0&hash=item1c245a7a80#ht_4731wt_1163)

Now these are really nice and bright but the problem is they don’t appear to be able to make all the colours like purple yellow and such.

I was wondering if you could point me to the correct lights i need.

---

<div class="post-metadata">

**Author:** ![skimask](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@skimask](https://community.sparkfun.com/u/skimask)\
**Post date:** [March 4, 2012, 2:46am UTC](https://community.sparkfun.com/t/led-question/23503/2 "2012-03-04T02:46:18Z")

</div>

[http://en.wikipedia.org/wiki/RGB](http://en.wikipedia.org/wiki/RGB)

---

<div class="post-metadata">

**Author:** ![6Maverick6](https://avatars.discourse-cdn.com/v4/letter/6/e9c0ed/32.png) [@6Maverick6](https://community.sparkfun.com/u/6Maverick6)\
**Post date:** [March 4, 2012, 3:02am UTC](https://community.sparkfun.com/t/led-question/23503/3 "2012-03-04T03:02:44Z")

</div>

> skimask:  
> [http://en.wikipedia.org/wiki/RGB](http://en.wikipedia.org/wiki/RGB)

Thanks and while playing around i work it out.

They are completely opposite to the one that come with my aruidno.

Off is on and On is off.

---

<div class="post-metadata">

**Author:** ![rocketboy07](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@rocketboy07](https://community.sparkfun.com/u/rocketboy07)\
**Post date:** [March 4, 2012, 4:56pm UTC](https://community.sparkfun.com/t/led-question/23503/4 "2012-03-04T16:56:49Z")

</div>

The LED’s that you got from ebay are common anode, if you got the sparkfun inventors kit those are common cathode. This is why on is off and off is on for you. You might need to change the way you have them wired is all to make on, on again.

---

<div class="post-metadata">

**Author:** ![Philba](https://avatars.discourse-cdn.com/v4/letter/p/ed655f/32.png) [@Philba](https://community.sparkfun.com/u/Philba)\
**Post date:** [March 4, 2012, 11:46pm UTC](https://community.sparkfun.com/t/led-question/23503/5 "2012-03-04T23:46:26Z")

</div>

You don’t need to change the wiring, just the logic. If you are using 8 bit PWM (i.e. analogWrite) - then simply subtract the PWM value from 255 and write the result.

You should also determine each LED’s Vf and adjust the dropping resistor to get similar brightness. I’d at least start with the same current through each LED. (by LED, I mean each of the 3 LEDs in the package). Ideally, you would have something like one of the SFE color sensors to determine intensity so that you can better tune the LEDs. But, just eyeballing it is probably good enough. This will allow you to get more precise colors.

You may also want to adjust the pwm value to account for the logarithmic response of the eye.
