I need an awesome person to help me with NeoPixel LED code.

Hello,

I'm trying to put together a busy box for my kid and unfortunately I got stuck at controlling aNeopixel rgb strip with buttons.

I have some coding knowledge but not sufficient to build this from scratch. I've tried to include all the information regarding the hardware and the behavior I want below.

=== Hardware Schematic ===
-> https://puu.sh/Hp6PX/c4479e26b1.png
-> 3 buttons - Momentary push buttons
-> Neopixel Jewel (7 LEDS's L1 -> L7) NeoPixel Jewel - 7 x 5050 RGB LED with Integrated Drivers : ID 2226 : $5.95 : Adafruit Industries, Unique & fun DIY electronics and kits

Button 1 (B1)- Red;
Button 2 (B2)- Green;
Button 3 (B3)- Blue;

Behavior:

=== Start with all the leds OFF.

(Combine = If the led is on, and has a different color already assigned, combine the color that is already present with the color set by the button)

=== First push (single button):

Push B1 - Turn On: L1, L2, L7 ; Combine L1, L2, L7
Push B2 - Turn On: L3, L4, L7 ; Combine L3, L4, L7
Push B3 - Turn On: L5, L6, L7 ; Combine L5, L6, L7

=== Second push (single button):

Push B1 - Turn On: L6, L1, L2, L3, L7 ; Combine L1, L2, L3, L6, L7
Push B2 - Turn On: L2, L3, L4, L5, L7 ; Combine L2, L3, L4, L5, L7
Push B3 - Turn On: L4, L5, L6, L1, L7 ; Combine L1, L4, L5, L6, L7

=== Third push (single button):

Push B1 - Turn On: All(1->7) ; Combine all led's with B1 colour
Push B2 - Turn On: All(1->7) ; Combine all led's with B2 colour
Push B3 - Turn On: All(1->7) ; Combine all led's with B3 colour

=== Fourth push:

Push B1 - Turn off: L1, L2 (if no other leds are on, turn off L7 too) ; Combine - Remove red colour from all LED's;
Push B2 - Turn off: L3, L4 (if no other leds are on, turn off L7 too) ; Combine - Remove green colour from all LED's;
Push B3 - Turn off: L5, L6 (if no other leds are on, turn off L7 too) ; Combine - Remove blue colour from all LED's;
*Special case - If all LED's are off reset all colors to default color;

*** Nice to have ***

  • All 3 buttons at once for 3 seconds - Rainbow color circling
  • Hold any button down for 3 seconds - (button)Color circling on all leds
  • Hold any two buttons down for 3 seconds - Combine the button colors and circle on all led's

Thank you for your support. With a bit of help i managed to hack it in the end and come up with something usable !

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.