Interfacing multiple RGB Switches

Status
Not open for further replies.

benscammell

Well-known member
So if you have a switch with an RGB LED in it... I'm trying to work out how to interface multiple RGB buttons.

I've debated a ATtiny uC with the RGB LED and switch hung off it which in turn connects to Teensy over I2C with a common interrupt line, so if a button is pressed the ATtiny pings the common interrupt pin on the Teensy so it knows to read the state of all the buttons over the I2C... to see which one was pressed.

Thoughts?

Ben
 
The cheapest but somewhat CPU intensive way is probably with ShiftPWM and several '595 chips.

Another cheap and perhaps easier way would use WS2811 chips, and either the NeoPixel or FastLED library, or even OctoWS2811 if you have a *lot* of them!

Each chip drives only 1 LED, but they seem to go for about 10 to 15 cents on Ebay & Aliexpress. For example:

http://www.ebay.com/itm/100Pcs-WS2811S-WS2811-SOP-8-WORLDSEMI-CHIP-IC-top-/262136735410
http://www.ebay.com/itm/50PCS-WS2811S-WS2811-SOP-8-WORLDSEMI-CHIP-IC-top/181846990836

A simpler but not so cheap way would involve a product like this:

https://www.adafruit.com/products/815

If I was building something like a MIDI controller for myself or a friend, rather than something to be mass produced, I'd probably just get one or more of those and call it good.
 
Thanks, Paul.

It's for more than just the MIDI controller, I've long thought it would be useful to have a nice solution for RGB buttons... how processor intensive is maintaining a colour with a WS2811?

What would be nice is the chip inside the APA102, as it maintains the PWM with no CPU cost.

Ben
 
In the absence of more communication, WS2811 will continue driving the LED with the same color indefinitely. Well, as long as power is on and stable. So no processor activity is needed at all to merely maintain the same color.
 
In the absence of more communication, WS2811 will continue driving the LED with the same color indefinitely. Well, as long as power is on and stable. So no processor activity is needed at all to merely maintain the same color.

Ah I see now, the primary difference between APA102 and WS2811 is that the timing is critical during changes to what is being displayed on the WS2811... so interrupts need to be diabled during the update, but if not updating both LED types will display persistantly... albeit the APA102 at a higher PWM frequency.

Thanks (again) for clearing things up for me Paul.
 
Any thoughts Paul?

how processor intensive is maintaining a colour with a WS2811?

Thanks, Ben

I'm combining RGB rotary encoders with RGB backlit arcade buttons on the same board.

I'm using both WS2811's (well... WS2812b) for the buttons and adafruit 815 (as linked by paul) for the rotary encoders.

If I could get RGB rotary encoders which had neopixels in them i would, it's just so much easier, less pins to worry about, it's just a nice clean solution.

I've found the neopixels to be very stable indeed once I've got the wiring right - but you do get the odd one which isn't exactly the same colour hue. 1/16 in my limited experience.
 
Status
Not open for further replies.
Back
Top