I have a project that requires action if a certain error value has existed for a certain time. This code is executed every millisecond and the time might be 200mS.
I check for the error and if it's present check the time, if not, I reset the time variable. I.E.
I "think" my logic is correct but somehow it looks wrong.
Can anyone see a flaw in this logic?
Thanks,
Mike.
I check for the error and if it's present check the time, if not, I reset the time variable. I.E.
Code:
ticks++;
If(error>=errorLimit){
if(ticks>=timeLimit){
//do action
}
}else{
ticks=0;
}
Can anyone see a flaw in this logic?
Thanks,
Mike.