Staacks / there.oughta.be

Projects featured on my blog at https://there.oughta.be
https://there.oughta.be
GNU General Public License v3.0
101 stars 33 forks source link

Temperature inversion #5

Closed leoceto closed 3 years ago

leoceto commented 3 years ago

First of all, amazing job !!!! The cube is super impressive and everything is working super well. Even if it is your project, it was super fun to copy cat it !

Not a big issue, but my temperatures are inverted on my version of the cube, I don't know why. when temperature are above 70, the cube is blue, when they are below 40, the cube is red....

I modify the first lines to fix that but I don't understand why i have such a behavior....

`#define T1 80.0 // instead of 40

define T2 60.0

define T3 40.0` // instead of 80

Staacks commented 3 years ago

That would be very weird. Are you sure that it is not just panels with a different RGB order, like BGR? in that case, you might prefer to set change that: 500:https://github.com/Staacks/there.oughta.be/blob/373d4e43f3dc867180ae8bb76ad156241c932dfe/led-cube/led-cube/cpu-stats-gl.cpp#L500

The actual colors are defined in the shader: https://github.com/Staacks/there.oughta.be/blob/373d4e43f3dc867180ae8bb76ad156241c932dfe/led-cube/led-cube/cpu-stats-gl.cpp#L175

mcolor, mcolorwarm and mcolorhot are the background and ccolor, ccolorwarm and ccolorhot are the ring (mostly white tones with a light blueish and then reddish tint). You might notice that mcolor is a rather turquoise color by definition, but the green channel is later varied across the x axis, which leads to the variation of blue to turquoise in the cold state: https://github.com/Staacks/there.oughta.be/blob/373d4e43f3dc867180ae8bb76ad156241c932dfe/led-cube/led-cube/cpu-stats-gl.cpp#L217

The reason I am explaining this is that if it is actually an BGR panel and you fix it by switching the temperature mapping, you will get a red to yellow gradient in your hot state, your moderate temperature will look turquoise and your cold state will be a solid blue.

So, just you know why your cube might look a bit different than in the video...

leoceto commented 3 years ago

First of all, thank ou so much for the quick answer.... I even did not know that BGR panels exist, I have changed the line defaults.led_rgb_sequence = "RGB" to defaults.led_rgb_sequence = "BGR"

and now it is fully working....

Thanks !!! 👍