Pulse Brightness on the WS2801 LEDS

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
joshuakane
 
Posts: 282
Joined: Sat Apr 13, 2013 4:40 pm

Pulse Brightness on the WS2801 LEDS

Post by joshuakane »

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

  strip.setPixelColor(4,Color(0, 128, 255));

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

Thanks!

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Pulse Brightness on the WS2801 LEDS

Post by adafruit_support_rick »

You set the brightness with the color codes.

Code: Select all

  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.

User avatar
joshuakane
 
Posts: 282
Joined: Sat Apr 13, 2013 4:40 pm

Re: Pulse Brightness on the WS2801 LEDS

Post by joshuakane »

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
adafruit_support_bill
 
Posts: 88086
Joined: Sat Feb 07, 2009 10:11 am

Re: Pulse Brightness on the WS2801 LEDS

Post by adafruit_support_bill »

By all means! Post up some photos when you are done. :D

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

Return to “Arduino”