Rainbow - Brightness


#1

Hello ,

I have been testing the rainbow through the flotilla python API and I havent been able to change the brightness. Im using the command: rainbow.set_brightness(brightness) sending values from 1 to 150 since I saw on the class that the initial value is 150. Do I need to do anthing else like a rainbow.update()? What are the values that the brigthness paramater can take?

Greetings


#2

I see that in the Matrix library (matrix.pi) you send the brightness:

def update(self):
    self.send(self.pixels + [self.brightness])

but in the Rainbow the brightness is never sent:

def update(self):
    data = []
    for pixel in self.pixels:
        data += list(pixel)
    self.send(data)        

I tried modifing the rainbow library and adding the brightness in the update function:

self.send(data+ [self.brightness]) just like in the matrix but it didnt work. Any suggestions?

Greetings


#3

I need to take a look at the Dock Firmware and confirm Brightness is being handled correctly. I ran across this while working on the Python library and made another “I’ll fix it when I get time” mental note.

I’ve got time, so I’m going to look into it.

Edit: As I suspected, Brightness for the Rainbow currently isn’t implemented in the Dock firmware. Added to the GitHub issues so I don’t forget.


#4

Ok, I hope you guys have time to add it to the firmware soon, The maximum brigtness is kind or anoying. I already found an appllication for the Flotilla and the Rainbow but with the current brightness I cant use it.


#5

It’s somewhat eye-bleeding.

You can dial the brightness back somewhat by scaling each colour value proportionally, so assuming you wanted a brightness of 50% then you could

r *= 0.5
g *= 0.5
b *= 0.5

Changes to the firmware will have to wait until January, I’m afraid!


#6

When I was playing with direct serial access, I sent values between 0-255 for r,g,b. All worked fine. They Python library for rainbow has a brightness value but it does nothing with it.

You could modify the library to scale all the values. But its simpler to just ignore the idea of brightness and just set your RGB values appropriately in your own software.

And yes they’re crazy bright. Values up to about 50 are more eye friendly - especially for development where you tend to stare at the things.


#7

I’ll definitely fix it when I’m back in the office. I’m sure I’ll have a batch of maintenance changes to make by then to the Dock, Python and Rockpool to bring them all into sync.

There’s a dozen things that I can see need doing with existing software right off the cuff- it’s an interesting problem since it makes it look like we spent no time working on the software but in actual fact:

  1. We didn’t have final docks/modules to test it against until relatively recently
  2. It’s actually been rewritten from almost scratch over and over again, when we implemented the minimal theme that was actually a near total rebuild.

I think there will be a lot of tales to tell about the process one day! If anyone’s interested in them.


#8

as long as you wear an eye patch, rest heavily on a oak-made cane, an oversized ring on your finger, sure I’d pay good money to attend such an event… In fact I’d probably cross the 7 seas just to be there!


#9

Any updates on fixing the firmware for adjusting the brightnes of the rainbow led strip?


#10

There’s a fix in the ShipShape version of the Python API which includes brightness control for rainbow. A firmware fix wont be necessary. Since there’s no brightness control register on the SN3218 it would be redundant.

The ShipShape branch is here:
https://github.com/pimoroni/flotilla-python/tree/shipshape

I highly recommend using the new firmware with it. Although it should work with the old, performance will be pretty ropey.