Skip to content

Instantly share code, notes, and snippets.

@firmread
Last active August 29, 2015 13:56
Show Gist options
  • Save firmread/9127426 to your computer and use it in GitHub Desktop.
Save firmread/9127426 to your computer and use it in GitHub Desktop.
pseudocode for counting up every 3 minutes in OF
void setup(){
counter=0;
bCounted=true;
}
void update(){
//check time progress
if(ofGetElapsedTimef()- (counter*180) > 180)
bCounted = false;
}
//count up each 3 minutes
if(bCounted == false){
counter++;
bCounted = true;
}
if(counter%2 == 0) do something;
else if (counter%2 == 1) do some other thing;
}
int counter;
bool bCounted;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment