Hello all! I've come a long way with my project and have learned how to multitask and have a plan for how to implement the many LED, sound, and servo components that I need for this project. I am, however, still struggling with a couple of things.
First, I've been trying to get a realistic lightning effect from a string of LEDs. I've tried various codes for random flashes, and even tried hooking the output of the sound shield I'm using to an input pin to watch for certain levels and turn on and off the strip accordingly, but nothing seems to work reliably. To make it even more complicated, since I'm running a lot of things at "once" I don't want to use delay. Thus, I'm just curious if anyone had any suggestions as to what to do. I would need the effect to turn on at a certain time and turn off at a certain time, as well. (It's not going for the whole program). So, I almost need a loop within a loop of some kind.
My second issue is sort of the same. I want a strip of LEDs to appear to be flickering like candles. Like the lightning strip, the effect needs to be able to be on until a certain time and off for a bit, then back on. My main issue here is implementing this effect without delay using millis and not screwing up the other components of the program.
Attached is what I've got with the project thus far. I've experimented with the lightning, and have been able to dictate when things turn on and off using timers, but the specific code for the above desired effects is what I've really been struggling with.
Any help would be very much appreciated. Thanks!
HMSR2.ino (5.88 KB)