I have a program that is dependent of millis() so it runs as soon as I run the program, now I want to add a feature where I would have an idle program with a white screen first and everything runs only when the mouse is clicked, basically I want a way to save and use the exact time the mouse is clicked or start millis() from the moment mouse is clicked to initiate the program
right now when I start the program, it has already started running at the background even before I click the mouse because my code depends on millis(which is always increasing regardless of mouseClicked)
plus once the program is running, how would I write a code that interrupts and restarts the program everytime I click the mouse?
boolean Start= false
void setup {
"whatever"
}
void draw {
if (Start){
" eg. if(millis() < 10) {
line(x,y,width,height)"
}
void mousePressed(){
Start = true;
}
1