513
edits
Line 107: | Line 107: | ||
This enum assigns different names to values: | This enum assigns different names to values: | ||
[[File:robot_enum.jpg]] | |||
Note (enum + Processing): the definition of an enum has to be saved in a separate file (tab) with an .java extension. ([http://stackoverflow.com/questions/13370090/enums-in-processing-2-0 more info] ) | Note (enum + Processing): the definition of an enum has to be saved in a separate file (tab) with an .java extension. ([http://stackoverflow.com/questions/13370090/enums-in-processing-2-0 more info] ) | ||
Line 119: | Line 119: | ||
It could for instance run over and over again in the main loop-function of our program: | It could for instance run over and over again in the main loop-function of our program: | ||
[[File:robot_loop1.jpg]] | |||
Line 136: | Line 136: | ||
This is an example of how the „standy“-state could look like: | This is an example of how the „standy“-state could look like: | ||
[[File:robot_standbyfunc.jpg]] | |||
Line 143: | Line 143: | ||
We can now call each particular function in the appropriate part of the switch/case statement. | We can now call each particular function in the appropriate part of the switch/case statement. | ||
The functions return value is saved in the state variable for the next loop. | The functions return value is saved in the state variable for the next loop. | ||
[[File:robot_loop1.jpg]] | |||
edits