07-26-2016 04:02 AM
@Ken_Naylor wrote:Your counter indicator will not update until the loop has finished executing and then it will display either 0 (counting down) or 255 counting up. If you want to see the indicator labled 'counter' counting up (or down) then the indicator (or a local variable attached to the indicator) MUST be inside the loop.
Ken
Even I put the indicator inside the SCTL the counter value still not counting 1 by 1.
07-26-2016 04:43 AM
Try this code
07-26-2016 04:53 AM
Or this which is close to your original (I think the solution from PalanivelT is better though)
07-26-2016 02:17 PM - edited 07-26-2016 02:25 PM
Your inner loop has a fixed number of iterations, known before the loop starts, thus it needs to be a FOR loop.
Since the two cases are nearly identical, you don't need a case structure.
Here's one possibility:
Feel free to adjust the time delay (currently 200ms).
This is much less cluttered that some of the other suggestions with lots of duplicate code and even local variables. 😉