-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMoveStepper.py
54 lines (41 loc) · 1.88 KB
/
MoveStepper.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
from ESP32RestSerialAPI import ESP32Client
import time
steps = 1000
#perform a lateral shift in the x direction
serialport1 = 'COM8'
Motor = ESP32Client(serialport=serialport1)
#Motor.move_stepper(steps=(10, -10, 0), speed=100, is_absolute=False, is_blocking=True)
#.move_stepper((2000, 0, 0), speed=100, is_absolute=False, is_blocking=True)
#Motor.move_stepper(steps=(10, 0, 0), speed=100, is_absolute=False, is_blocking=True)
#time.sleep(2)
print("Move in X")
Motor.move_stepper(steps=(0, 1000, 0), speed=200, is_absolute=False, is_blocking=True)
#Motor.move_stepper(steps=(1000, -1000, 0), speed=100, is_absolute=False, is_blocking=True)
#print("Move in Y")
#Motor.move_stepper(steps=(0, 2000, 0), speed=100, is_absolute=False, is_blocking=True)
print("Move in -X")
#Motor.move_stepper(steps=(+4000, 0, 0), speed=100, is_absolute=False, is_blocking=True)
#print("Move in -Y")
#Motor.move_stepper(steps=(0, -2000, 0), speed=100, is_absolute=False, is_blocking=True)
'''
print("Move in Y")
Motor.move_stepper((0, 2000, 0), speed=100, is_absolute=False, is_blocking=True)
print("Move in -X")
Motor.move_stepper((-2000, 0, 0), speed=100, is_absolute=False, is_blocking=True)
print("Move in -Y")
Motor.move_stepper((0, -2000, 0), speed=100, is_absolute=False, is_blocking=True)
'''
'''
Motor.move_stepper(axis=1, steps=-steps, speed=100, is_absolute=False, is_blocking=True)
print("Move in X")
#time.sleep(max(6, 3*steps//1000))
Motor.move_stepper(axis=2, steps=+steps, speed=100, is_absolute=False, is_blocking=True)
print("Move in y")
#time.sleep(max(6, 3*steps//1000))
Motor.move_stepper(axis=1, steps=+steps, speed=100, is_absolute=False, is_blocking=True)
print("Move in X")
#time.sleep(max(6, 3*steps//1000))
Motor.move_stepper(axis=2, steps=-steps, speed=100, is_absolute=False, is_blocking=True)
print("Move in y")
#time.sleep(max(6, 3*steps//1000))
'''