6v6gt:
It is not nice to update a for loop control variable in the for loop
timer=0;
There is absolutely nothing wrong with updating the variable within the for loop, and there are many valid reasons for doing so. But, in this instance, it begs the question - Why not use a while or do loop instead, since the end condition of the for will likely never be true...
6v6gt:
It is not nice to update a for loop control variable in the for loop
timer=0;
This is rather odd. Under what circumstances do you think this if statement is/is not going to be true ?
if (timer/1000){
. . .
}
This is my attempt to have a smaller clock variable to work with instead of having to worry about long numbers. 1200 is not divisable by 1000 without a remainder, but maybe the syntax is what I'm missing to be able to evaluate that properly.
setting timer back to 0 continues the loop. is this unnecessary code?
I was able to figure out the issue. researched and found that I needed to be using a modulus to determine if timer/100 had a remainder of 0 to auto-increment pumpClock.
midiean:
I was able to figure out the issue. researched and found that I needed to be using a modulus to determine if timer/100 had a remainder of 0 to auto-increment pumpClock.