mirror of
https://github.com/eclipse/upm.git
synced 2025-07-01 09:21:12 +03:00
md: C implementation; C++ wraps C
Signed-off-by: Jon Trulson <jtrulson@ics.com>
This commit is contained in:
@ -40,13 +40,13 @@ def main():
|
||||
myMotorDriver.setStepperSteps(100)
|
||||
|
||||
# let it go - clockwise rotation, 10 RPM speed
|
||||
myMotorDriver.enableStepper(upmmd.MD.STEP_DIR_CW, 10)
|
||||
myMotorDriver.enableStepper(upmmd.MD_STEP_DIR_CW, 10)
|
||||
|
||||
time.sleep(3)
|
||||
|
||||
# Now do it backwards...
|
||||
myMotorDriver.setStepperSteps(100)
|
||||
myMotorDriver.enableStepper(upmmd.MD.STEP_DIR_CCW, 10)
|
||||
myMotorDriver.enableStepper(upmmd.MD_STEP_DIR_CCW, 10)
|
||||
|
||||
# now disable
|
||||
myMotorDriver.disableStepper()
|
||||
|
@ -34,14 +34,14 @@ def main():
|
||||
|
||||
# set direction to CW and set speed to 50%
|
||||
print("Spin M1 and M2 at half speed for 3 seconds")
|
||||
myMotorDriver.setMotorDirections(upmmd.MD.DIR_CW, upmmd.MD.DIR_CW)
|
||||
myMotorDriver.setMotorDirections(upmmd.MD_DIR_CW, upmmd.MD_DIR_CW)
|
||||
myMotorDriver.setMotorSpeeds(127, 127)
|
||||
|
||||
time.sleep(3)
|
||||
# counter clockwise
|
||||
print("Reversing M1 and M2 for 3 seconds")
|
||||
myMotorDriver.setMotorDirections(upmmd.MD.DIR_CCW,
|
||||
upmmd.MD.DIR_CCW)
|
||||
myMotorDriver.setMotorDirections(upmmd.MD_DIR_CCW,
|
||||
upmmd.MD_DIR_CCW)
|
||||
time.sleep(3)
|
||||
|
||||
print("Stopping motors")
|
||||
|
Reference in New Issue
Block a user