Excuse my ignorance, but I ran into a problem that turned out to be challenging for my current knowledge in programming with Processing, even though the idea is quite simple
Ringo has a solution that's perfectly fine.
Another way you can do this easily is:
bool addOnce = false;
void draw()
{
int time = (millis() % 10000) / 1000;
if (time == 9)
{
if(!addOnce) {
addOnce = true;
i++;
}
} else { addOnce = false; }
}
As long as time == 9
, we'll only get through if(!addOnce)
one time.
After it changes, we reset the flag.