Order / What is exeuted in a Processing program??
in
Programming Questions
•
3 years ago
I'm confused. Docs say that draw() is executed after setup() and loops unless controlled (noloop etc).
I am running the example: SerialCallResponse. The order on the page is:
Declarations
setup()
draw()
void serialEvent(Serial myPort)
What actually happens is that BOTH draw() and the serialEvent functions run in a loop. So the program works fine.
BUT I expected anything in the main loop to have to be INSIDE draw()
I searched examples and docs and still confused.
Can you straighten me out??
Regards, Terry King ..On the Red Sea at KAUST.edu.sa
terry@terryking.us
Newsletter: http://redseanews.info Community Information: http://redseainfo.info
I am running the example: SerialCallResponse. The order on the page is:
Declarations
setup()
draw()
void serialEvent(Serial myPort)
What actually happens is that BOTH draw() and the serialEvent functions run in a loop. So the program works fine.
BUT I expected anything in the main loop to have to be INSIDE draw()
I searched examples and docs and still confused.
Can you straighten me out??
Regards, Terry King ..On the Red Sea at KAUST.edu.sa
terry@terryking.us
Newsletter: http://redseanews.info Community Information: http://redseainfo.info
1