This is a debounce circuit and code to control neopixels using a rotary encoder and an arduino. Turning the knob of the rotary encoder will switch the mode of the neopixels.

This project requires four 10k ohm resistors, two 10nF capacitors, one 50V 1000µF capacitor, one Adafruit rotary encoder (, and one Arduino controller. Simply load the provided code onto the Arduino, and arrange to components as shown. Pressing down on the knob of the rotary encoder will turn the neopixels on and off, while turning the knob will cycle through different colors and patterns. The biggest bug that I have not fixed is that on three of the patterns, it will not switch to a new pattern until that pattern has ru all the way through.