I haven't got a hue
Erlend
Posts: 612
I would like to control a single WS2812B to set its hue - using it as a status indicator. It would only need to be set/changed when events occur - every few seconds or so. I am PASM-blind, and after having waded through a number of drivers I have found, trying to simplify and extract exactly what I need, I am thinking I am spending too much time getting nowhere. Can anyone help me with a simple solution? - ideally SetHue(pin, hue), where hue is a pointer to a long having the value $RR_GG_BB_WW
Note, I am approaching my 32k limit for the total project, so I need to avoid extensive driver objects.
Erlend
Note, I am approaching my 32k limit for the total project, so I need to avoid extensive driver objects.
Erlend
Comments
An interesting development with the P2 is that you can implement small sections of PASM2 in your Spin code. I used this to create a no-frills output routine for WS2812s.
Again, this is Spin2: It wouldn't be a direct translation but you could pull the PASM code from your favorite driver and stick it into your main object with a couple methods to start and stop it. Since your code is controlling the LED color, all the methods normally included in a standard smart LED object could be chucked out. You can also save a bit of space in the PASM by changing the byte order you send to the driver. Many drivers use RR_GG_BB_WW to simplify creating constants, but the PASM code has to swap the red and green bytes. If you send GG_RR_BB_XX to the embedded driver then you can save a bit of code there.
I wrote the code a bit more generically than you asked. You can add your set_hue() method like this:
Erlend
Also in lockdown.
Have fun, and stay healthy.
Thanks, and double thanks, and same good wishes to you.
I am tempted to continue your color prose... but now's dinner time. Chartreuse by the way is also the name and color of a very nice liquor made traditionally by French monks.
I've been involved with projects where status or event needed to be communicated, and in most cases subtlety in color discrimination was not desirable. For one example, wildland fire fighters carried an armband that indicated threshold levels of smoke exposure. The simple green, yellow and red had to be supplemented with a geometric pattern formed of several LEDs, green dot, yellow square, bright red X, so that the meaning could be picked up at a glance. Also, so that persons with red/green or other color blindness would have a primary que besides the hue. I've used a single RGB Led for similar purposes, where the additional que of what is true was a flashing or pulsating pattern.
I do not plead guilty.
My 'hue indicator' is not the primary (or critical) source of information. It is intended as a 'shortcut', such that when the user (repeatedly) want to make a menu selection, a hue is visible accordingly. The user will/can after a while, having noticed the association of a hue with a menu item, simply turn the knob until the desired hue is shone, and push the knob to activate. Or - for the color blind - continue to read the menu text before making a selection.
I can see your scheme nicely in context with a display shortcut. I don't mean to criticize! I'm interested and have used RGB leds (but not the smart kind) for color signals too, coupled with a text display and sound cues. It is effective and a lot of fun to play with. A university project on "behavioral intervention" even got to the point of using a focus group to parse the colors and sounds.
I also have fun experimenting with different combinations of sensory communication (been looking for a simple smell-generator, but may have to build it myself) in order to connect man-machine on a more intuitive level.