Neopixel setBrightness command

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
hammersmith
 
Posts: 16
Joined: Tue Jan 21, 2014 2:32 pm

Neopixel setBrightness command

Post by hammersmith »

Hello,

I'm wondering about the setBrightness command in the arduino Neopixel Library. I know that the Neopixel need 24 Bits of data 8 Bits per Color. So there are no Bits for Brightness. Isnt it so that the Brightness of the different colors is set by the value of the byte (means 0 = off 255 = very bright)?

so I wonder what purpose this command has. Maybe someone could explain it? :)

Thanks! :)

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

Re: Neopixel setBrightness command

Post by adafruit_support_rick »

it sets a global multiplier (actually, it's the numerator of a fractional multiplier).

For instance, if you call setBrightness(64), followed by setPixel(i, 255, 192, 128), setPixel will multiply each of r, g, and b by (64/255), so you wind up actually setting the pixel to (64, 48, 32)

User avatar
hammersmith
 
Posts: 16
Joined: Tue Jan 21, 2014 2:32 pm

Re: Neopixel setBrightness command

Post by hammersmith »

Oh thats kind of usefull thanks :D

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

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”