This code controls a neopixel lightsaber with an Arduino (I ran it on a nano). It has on/off effects, and slight pulsing of hue and saturation while on. It also switches to a party mode using the FastLED library for colorful patterns.
Here is a video I created showing the full build process for this saber (including the hilt): https://youtu.be/Dzpe1GVOJXU