Arduino Nano NeoPixel Button Loop
Budget: £10 – £15 GBP
I have a simple NeoPixel Sketch for the Arduino Nano. This is loosely based on the NeoPixel Adafruit buttoncycler example sketch and the tweaking4all examples https://www.tweaking4all.com/hardware/arduino/adruino-led-strip-effects/
This sketch cycles through 4 different NeoPixel effects at the press of a button. The button uses the ezbutton library for debounce.
The limitations of the current sketch is that I have to wait for each NeoPixel pattern in the cycle to complete before I can press the button and cycle forward to the next pattern. Each pattern has a delay(), which I understand to be not best practice.
Sketch to be modified is attached to the Project.
Project requirements:
Refactor the sketch so that:
- Each pattern loops indefinitely (currently each pattern only plays once)
- Interrupt any of the 4 patterns with a button press to cycle forward to the next pattern
- Remove reliance on delay(0) function
Other information:
Patterns:
0: All pixels off
1: Strobe flash with 1 second delay
2: Red colorWipe
3: Blue colorWipe
4: Red Fade in/out
Button Pin: 7
NeoPixel Pin: 6
# of Pixels: 4
This is considered a super simple project / sketch and the refactoring effort should be small (<1 hour work). Proposals over the project budget will be ignored.
This sketch cycles through 4 different NeoPixel effects at the press of a button. The button uses the ezbutton library for debounce.
The limitations of the current sketch is that I have to wait for each NeoPixel pattern in the cycle to complete before I can press the button and cycle forward to the next pattern. Each pattern has a delay(), which I understand to be not best practice.
Sketch to be modified is attached to the Project.
Project requirements:
Refactor the sketch so that:
- Each pattern loops indefinitely (currently each pattern only plays once)
- Interrupt any of the 4 patterns with a button press to cycle forward to the next pattern
- Remove reliance on delay(0) function
Other information:
Patterns:
0: All pixels off
1: Strobe flash with 1 second delay
2: Red colorWipe
3: Blue colorWipe
4: Red Fade in/out
Button Pin: 7
NeoPixel Pin: 6
# of Pixels: 4
This is considered a super simple project / sketch and the refactoring effort should be small (<1 hour work). Proposals over the project budget will be ignored.