Keybow led brightness


#1

Hi there.

I’ve been searching for a way to control the brightness of the led’s on my Keybow. Is that possible with the current version? Or maybe something that’s in the pipeline?

Thanks in advance!


#2

If you go here, and scroll down to the Manually setting each LED

https://learn.pimoroni.com/tutorial/sandyj/setting-up-the-keybow-os

You’ll see the colors are by R G B values, 255 being the brightest and 0 being off
keybow.set_pixel(0, 255, 255, 0) – Yellow
so if you change that too
keybow.set_pixel(0, 128, 128, 0) – you’ll get yellow but not as bright a yellow. I didn’t see any brightness value like you get with say the LED shim etc though. Give it a try and see how it turns out for you. I don’t own one myself.


#3

Thanks! Changing the colours isn’t the problem, and setting them to darker values does help. But apparently it should also be possible to actually adjust the brightness. See here, for instance:

That looks very interesting, but does way more than I need. I would simply like to set the brightness of the leds to 50% or so, and maybe even disable the led for individual keys.


#4

You don’t have to change the colors, just edit the values:
Example if your using Red ,(255, 0, 0) change it to (128, 0, 0) and its a dim Red.
The lower the number the lower the intensity of that LED. There are actually 3 LED’s in each key, a Red a Green and a Blue LED. The 3 sets of numbers determine it an LED is on or off and how bright it is.
For example (255, 255, 0) is Yellow, Red and Green LEDs on. Looks like I made a mistake up above, ops. Anyway, (128, 128, 0) should get you a dimmer yellow.
And setting an LED to (0, 0, 0) will turn it off. All three LED’s are off.


#5

Try this
keybow.set_pixel(0, 255, 0, 0, 0.5)
If it works it will set the brightness to 0.5.


#6

For some reason it never occurred to me to set all the values to 0. And that works a charm, of course. Thanks!

What doesn’t work is adding a percentage at the end. That would do the trick in css, but not here…


#7

I looked at the function reference for other products using those LED’s, like the Blinkt.
They will let you use the brightness value.
http://docs.pimoroni.com/blinkt/
Was rolling the dice to see if it maybe worked with the Keybow too. Looks like I crapped out, lol.

The values can be any number between 0 and 255,which works out to 0000000 to 1111111 in binary.
https://www.w3schools.com/colors/colors_rgb.asp
You can in theory get any color in the rainbow, and some that aren’t. Like purple.

My Sense Hat has a low light mode that dims the display to I think half brightness. My LED Shim also has a brightness value like the Blinkt. If you post a request on the Keybow gethub page it might be something they can add in.