Please be aware of all shipping deadlines before placing your order - we cannot guarantee orders will arrive before Christmas!

Pulse Brightness on the WS2801 LEDS
Moderators: adafruit_support_bill, adafruit

Pulse Brightness on the WS2801 LEDS

by joshuakane on Sat May 04, 2013 8:40 pm

How to do set the brightness on the WS2801 LED's?

I did not know if you could set a numerical value like you can with the RGB color codes

Code: Select all | TOGGLE FULL SIZE
  strip.setPixelColor(4,Color(0, 128, 255));



If I could be pointed to some example code it would be great.

Thanks!
User avatar
joshuakane
 
Posts: 194
Joined: Sat Apr 13, 2013 4:40 pm

Re: Pulse Brightness on the WS2801 LEDS

by adafruit_support_rick on Sat May 04, 2013 9:24 pm

You set the brightness with the color codes.

Code: Select all | TOGGLE FULL SIZE
  strip.setPixelColor(4,Color(0, 0, 255)); //bright blue
  strip.setPixelColor(4,Color(0, 0, 128)); //half-bright blue
  strip.setPixelColor(4,Color(0, 0, 32)); //dim blue

  strip.setPixelColor(4,Color(0, 128, 255)); //bright blue-green
  strip.setPixelColor(4,Color(0, 128, 255)); //half-bright blue-green
  strip.setPixelColor(4,Color(0, 16, 32)); //dim blue-green


That's a bit of a simplification, in that our eyes don't perceive the brightness linearly. So a value of 128 isn't really 'half' as bright as 255. But it's a good first approximation.

adafruit_support_rick
 
Posts: 14521
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: Pulse Brightness on the WS2801 LEDS

by joshuakane on Sun May 05, 2013 5:54 am

Thanks Rick!

So this project that I have been working on is for a costume.

This is the second project, the first was a life bar style light project.

If you guys think it is worthwhile I can throw something together for "Wearable Wednesday" when it is complete.

The costume likely won't be done for a month or so, but I don't mind documenting it, and sharing the code and such with the community.

-- Joshua
User avatar
joshuakane
 
Posts: 194
Joined: Sat Apr 13, 2013 4:40 pm

Re: Pulse Brightness on the WS2801 LEDS

by adafruit_support_bill on Sun May 05, 2013 6:22 am

By all means! Post up some photos when you are done. :D
User avatar
adafruit_support_bill
 
Posts: 32638
Joined: Sat Feb 07, 2009 10:11 am