Hi everyone!
I did some testing on my Arduino beforehand but it seems I can't get it to work properly; and therefore this thread is made
First to the program itself. I was trying to program a function which randomly fades 4 LEDs at different durations and different intensities but I ended up in having just some kind of semi-randomness. Gladly I found this library LEDfader which did exactly was I was trying to achieve:
Like mentioned this program creates random numbers for the durations/intensities of the LEDs. In my case the duration is between 500 and 1200ms and the intensity moves between 100 and 180. Okay. Fine!
The only problem I have been encountering was a function that increases the random intensity-value's as long as a button is pressed. It should get increased from 100/180 to 180/255.
I managed to have the values stored in variables (applause) which get called in the random()-function but I simply cannot get the increased variables to work as long the button is pressed.
I'm not to 100% sure where to put the check at (before the for-loop I guess?!) and where there should be another function which reads when the button is released. I tried different approaches but neither one of them worked!
The program shouldn't be stopped either when any action is performed so I'm not sure if that's even possible with that kind of program (for-loop).
Can you guys help me out on that one? It's driving me nuts!
Cheers and thanks so much in advance,
Mario