Wrote README.md and created .gitignore
This commit is contained in:
26
example_custom_script.py
Normal file
26
example_custom_script.py
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# This script instructs the "lin1" motor (first axis of the sinqtest Turbo PMAC
|
||||
# controller) to drive to -20 mm. Once it arrives, it then drives to -30 mm.
|
||||
# Afterwards, the motor is disabled and then reenabled
|
||||
|
||||
import time
|
||||
|
||||
from common import TurboPMAC
|
||||
|
||||
motor = TurboPMAC('turboPmac1', 'lin1')
|
||||
|
||||
# Drive to position -20 mm
|
||||
motor.move_and_wait(-20)
|
||||
|
||||
# Drive to position -30 mm
|
||||
motor.move_and_wait(-30)
|
||||
|
||||
# Disable the motor
|
||||
motor.write_field('enable', 0)
|
||||
|
||||
# Wait a bit so the motor has been disabled
|
||||
time.sleep(2)
|
||||
|
||||
# Reenable the motor
|
||||
motor.write_field('enable', 0)
|
||||
Reference in New Issue
Block a user