I built some custom headlights for a 4-Wheeler and I have always wanted to use Neopixels in one of my custom applications. So this was a great opportunity!
I wanted to add several different flash patterns but as my deadline approached, I realized I that my customer would have to toggle through allllll the patterns in order to turn them off. So as you can see in the code, I added an "off" function after each pattern so he can turn them off quickly if needed.
I know there would be away to use the output of some IR remote or something similar, but in the particular application, where the customer goes off road all the time, I didn't want him to lose (or have to keep up with) the remote. That is why I used a momentary switch.
Finally, my question is, how would one of you have gone about this code where you HAVE to use a button (or multiple, but the fewer the better). Can one of you think of a way the user could hold the button for a set amount of seconds to turn the Neopixels off?
On a side note, I wanted the pixels to "Meteor Rain" with ignition, however, I wanted them to stop after a certain amount of "raining" they would just go on and on.
Thanks in advance!
For anyone intrested I used a 12V to 5V Converter for the Arduino and the Neopixels
FastLEDheadlights.ino (22.3 KB)