reprap (version 2.0) | index /usr/lib/python2.5/site-packages/reprap/__init__.py |
This is the main pyRepRap module for controlling a serial
SNAP RepRap machine.
Import this module and use the internally created objects
reprap.cartesian and reprap.extruder to control the machine.
Example:
# Import the reprap modules
import reprap, time
# Initialise serial port, here the first port (0) is used.
reprap.openSerial( 0, 19200, 60 )
# These devices are present in network, will automatically scan in the future.
reprap.cartesian.x.active = True
reprap.cartesian.y.active = True
reprap.cartesian.z.active = True
reprap.extruder.active = True
# Set axies to notify arrivals
reprap.cartesian.x.setNotify()
reprap.cartesian.y.setNotify()
reprap.cartesian.z.setNotify()
# Set stepper speed to 220 (out of 255)
reprap.cartesian.setSpeed(220)
# Set power to 83%
reprap.cartesian.setPower(83)
# The module is now ready to recieve commands #
# Send all axies to home position. Wait until arrival.
reprap.cartesian.homeReset()
# When using seek with no waitArrival = True/False argument, it defaults to true
# Seek to X1000, Y1000
reprap.cartesian.seek( (1000, 1000, None) )
# Pause
time.sleep(2)
# Seek to X500, Y1000
reprap.cartesian.seek( (500, 1000, None) )
time.sleep(2)
# Seek to X1000, Y500
reprap.cartesian.seek( (1000, 500, None) )
time.sleep(2)
# Seek to X100, Y100
reprap.cartesian.seek( (100, 100, None) )
# Send all axies to home position. Wait until arrival.
reprap.cartesian.homeReset()
# Shut off power to all motors.
reprap.cartesian.free()
Package Contents | ||||||
|
Classes | ||||||||||||||||||||||||||
|
Functions | ||
|
Data | ||
CMD_BACKWARD1 = 13 CMD_CALIBRATE = 9 CMD_DDA = 11 CMD_FORWARD = 1 CMD_FORWARD1 = 12 CMD_FREE = 6 CMD_GETDEBUGINFO = 54 CMD_GETMODULETYPE = 255 CMD_GETPOS = 4 CMD_GETRANGE = 10 CMD_GETSENSOR = 15 CMD_GETTEMP = 10 CMD_GETTEMPINFO = 55 CMD_HOMERESET = 16 CMD_ISEMPTY = 8 CMD_NOTIFY = 7 CMD_PRESCALER = 51 CMD_PWMPERIOD = 50 CMD_REVERSE = 2 CMD_SEEK = 5 CMD_SETCOOLER = 11 CMD_SETHEAT = 9 CMD_SETPOS = 3 CMD_SETPOWER = 14 CMD_SETVREF = 52 CMD_SYNC = 8 CMD_VERSION = 0 CMD__setTempScaler = 53 MOTOR_BACKWARD = 2 MOTOR_FORWARD = 1 SYNC_DEC = 3 SYNC_INC = 2 SYNC_NONE = 0 SYNC_SEEK = 1 UNITS_INCHES = 3 UNITS_MM = 1 UNITS_STEPS = 2 __author__ = 'Stefan Blanke (greenarrow) (greenarrow@users.sourceforge.net)' __credits__ = '' __licence__ = '\npyRepRap is free software: you can redistribute...ap. If not, see <http://www.gnu.org/licenses/>.\n' __license__ = 'GPL 3.0' __version__ = '2.0' cartesian = <reprap.cartesianClass instance at 0x7f61b5917cb0> extruder = <reprap.extruderClass instance at 0x7f61b5917c68> printDebug = False |
Author | ||
Stefan Blanke (greenarrow) (greenarrow@users.sourceforge.net) |
Credits | ||