Subroutines group several commands under one alphanumeric name. Define a routine with o <name> sub, finish it with o <name> endsub, then run it with o <name> call.
o park sub
G0 Z20
G0 X0 Y0
M5
o park endsub
o park call
A space is required between o and the name. The name may contain letters or numbers.
| Command | Result |
|---|---|
o <name> sub |
Starts a definition and replaces an existing routine with the same name |
o <name> endsub |
Ends the active definition |
o <name> call |
Dispatches each stored line in order |
o <name> list |
Prints the stored lines; intended as a development aid |
o <name> save |
Writes the definition to <name>.sub in the current directory; intended as a development aid |
Smoothie stores definitions in RAM. They disappear on reset unless you save and load them from storage.
o park save creates park.sub with the sub and endsub lines included. Use the Player module to play that file after each reset and restore the definition into RAM. Playing the definition records its lines; it does not call the routine.
The save command overwrites a file of the same name in the current working directory. Change to the intended directory with cd before saving.
CommandShell.cpp implements the O-word command subset.