Hi, same as the title really. I have built an LED light application which is controlled via a GUI in C#. Four LED strips with 12 LED's each are connected to one Arduino Mega and an LED wheel is connected to another Mega. I am writing to to serial ports when I am adjusting the trackbar and selecting the test buttons.
After a few different iterations I am now almost finished this, however, the LED colour wheel is spinning which is controlled by a for loop using a delay and if I adjust the trackbar while it is in the delay it is obviously lagging behind.
I send the RGB command and PWM value across as a string in packets which I seen PaulS from
here using, this totally changed my program and got it working so much better than it was before. Example: .
Would I be able to get millis() to control the timing of a for loop?
Would I be able to get millis() to control the timing of a for loop?
That is something only you are able to assess. Personally, I could. The blink without delay example provides some information. You'll obviously need to get rid of the for loop and implement a state machine that is tested on every pass through loop().
It looks like you used the Copy for forum option in the IDE. That was a misguided attempt that has never worked. But, like all "features", once added can never be removed, no matter how useless.