Skip to content

Instantly share code, notes, and snippets.

@pyrho
Last active October 11, 2023 13:14
Show Gist options
  • Save pyrho/2059a33015346ad7ffb974c5c76fd844 to your computer and use it in GitHub Desktop.
Save pyrho/2059a33015346ad7ffb974c5c76fd844 to your computer and use it in GitHub Desktop.
GCode for timelapse trigger - Prusa MK4
;AFTER LAYER CHANGE
;[layer_z]
{ if layer_num >= 1 }
; Retraction is not needed
;G1 E-2 F3600 ; retract
G0 X0 Y170 F{travel_speed*60} ; get next to the switch
M400 ;Wait for all moves to finish
G0 X-1 F3000 ; press switch
M400 ;Wait for all moves to finish
G0 X1 F{travel_speed*60} ; Un-trigger, that's when the picture is actually taken
M400 ;Wait for all moves to finish
G4 P400;Wait for 400ms, to let the camera take the picture
; Retraction is not needed, so no priming either
;G1 E1.95 F3400 ; prime
;M400 ;Wait for all moves to finish
{endif}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment