Complete the code to start the G-code program with the correct command.
write_line('[1]') # Start of G-code program
The command G21 sets units to millimeters, which is commonly the first line in G-code programs.
Complete the code to output a rapid move to X=10, Y=20.
write_line('G00 X[1] Y20')
The rapid move command G00 moves quickly to the specified coordinates. Here, X should be 10.
Fix the error in the code to output a spindle start command at 1000 RPM.
write_line('M03 S[1]')
The spindle start command M03 with speed S1000 starts the spindle at 1000 RPM.
Fill both blanks to output a linear move to X=50 and feedrate of 1500.
write_line('G01 X[1] F[2]')
G01 is a linear move command. X=50 sets the position, and F=1500 sets the feedrate.
Fill all three blanks to output a program end with spindle stop and coolant off.
write_line('[1]') write_line('[2]') write_line('[3]')
M05 stops the spindle, M09 turns coolant off, and M30 ends the program.