Skip to content

Commit

Permalink
Gave extruder calibration script slightly more sensible defaults.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Zadoks committed Jun 23, 2011
1 parent 48b981f commit 0a5cb2d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions calibrateextruder.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from printdummy import printcore
except ImportError:
from printcore import printcore
import time,getopt,sys
import time,getopt,sys,os

def float_input(prompt=''):
import sys
Expand All @@ -36,14 +36,17 @@ def wait(t,m=''):
time.sleep(1.0/5)
print

if not os.path.exists(port):
port=0

#Parse options
help="""
%s [ -l DISTANCE ] [ -s STEPS ] [ -p PORT ]
-l --length Length of filament to extrude for each calibration step (default: %d mm)
-s --steps Initial amount of steps to use (default: %d steps)
-p --port Serial port the printer is connected to (default: %s)
-h --help This cruft.
"""[1:-1]%(sys.argv[0],n,k,port)
"""[1:-1]%(sys.argv[0],n,k,port if port else 'auto')
try:
opts,args=getopt.getopt(sys.argv[1:],"hl:s:p:",["help","length=","steps=","port="])
except getopt.GetoptError,err:
Expand All @@ -64,7 +67,7 @@ def wait(t,m=''):
print "Steps per mm: %3d steps"%k
print "Length extruded: %3d mm"%n
print
print "Serial port: %s"%port
print "Serial port: %s"%(port if port else 'auto')

#Connect to printer
print "Connecting to printer..",
Expand Down

0 comments on commit 0a5cb2d

Please sign in to comment.