# Some g-code examples and recipes G-code while being universal machine control language has various flavors and capabilities. Below section is dedicated to speed up manual machine control with simple commands. #### Move motors There are two basic linear motion commands G0 and G1. Both are generally the same just G0 uses default max speed constant from configuration. Examples (assume linear actuator is connected):
**Command** | **Explanation** |
`G0 X100` | Move X axis to absolute position 100mm |
`G1 X0 F100` | Move X axis to 0 position at speed 100mm/min |
**Command** | **Explanation** |
`M7` | MIST = ON |
`M8` | FLOOD = ON |
`M9` | MIST = OFF, FLOOD = OFF |
**Command** | **Explanation** |
`M3` | Set clockwise spindle rotation |
`S300` | Set spindle control pin PWM duty cycle at 30% (max S = 1000) |
`M4` | Set counter clockwise spindle rotation |
`M5` | Turn spindle off |
**Command** | **Explanation** |
`$HX` | Initialize X axis |
**Command** | **Output** |
`?` | ` |
**Command** | **Output** |
`$I` | `[VER:1.1f-SCE2.20200405:]` `[OPT:VMZHL,35,254]` `ok` |
**Command** | **Explanation and Output** |
`G38.2 F100 Z-100` | Move down Z axis until PROBE pin is triggered - F - Speed - Z - Target depth Replies with `[PRB:1.503,0.000,-22.860,0.000:1]` |
**Command** | **Explanation** |
`G4 P1.5` | Wait 1.5 seconds, reply with `ok` when done |
**Command** | **Explanation and Output** |
`$$` | Read parameters `$0=6` `$1=255` `$2=0` `$3=31` `...` `$132=360.000` `$133=360.000` `ok` |
`$132=100.00` | Set single paramter with the new value Replies with `ok` |
**Command** | **Explanation and Output** |
`M113 Px` | Control GPIO IO3, replies with `ok` |
`M114 Px` | Control GPIO IO4, replies with `ok` |
`M115 Px` | Control GPIO IO5, replies with `ok` |
`M116 Px` | Control GPIO IO6, replies with `ok` |
`M117 Px` | Control GPIO IO7, replies with `ok` |
`M120 Px` | Control GPIO LIM\_EN, replies with `ok` |