Like this?
if(count - lastCount >= interval){
lastCount = count;
...
}
It sounds like it is the same sort of one-shot edge-detection mechanism as in these:
Like this?
if(count - lastCount >= interval){
lastCount = count;
...
}
It sounds like it is the same sort of one-shot edge-detection mechanism as in these: