Skip to content

Instantly share code, notes, and snippets.

@Zwork101
Created March 21, 2018 17:40
Show Gist options
  • Save Zwork101/a521d73f7d06e1f5486d31957fa28150 to your computer and use it in GitHub Desktop.
Save Zwork101/a521d73f7d06e1f5486d31957fa28150 to your computer and use it in GitHub Desktop.
IT'S ALIVE
from gcode import GCode, Printer
g = GCode()
# get stuff setup
g.set_unit()
g.start_heating_extruder(230)
g.start_heating_bed(60)
g.go_home()
g.wait_heat_bed(55)
g.wait_heat_extruder(200)
# Start making stuff
g.comment("Let's start")
g.draw_to(20, 20)
g.draw_to(60, 60)
g.draw_to(60, 20)
g.code.append("M114")
# Write and run program
g.write_to_file('test.gcode')
p = Printer(120, 120, 120)
p.execute_file('test.gcode')
print(p.log)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment