-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmotor_test.py
More file actions
46 lines (42 loc) · 836 Bytes
/
motor_test.py
File metadata and controls
46 lines (42 loc) · 836 Bytes
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
#!/usr/bin/python
import time
import RPi.GPIO as GPIO
import datetime as dt
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(02, GPIO.OUT)
GPIO.output(02, False)
GPIO.setup(03, GPIO.OUT)
GPIO.output(03, False)
GPIO.setup(04, GPIO.OUT)
GPIO.output(04, False)
GPIO.setup(14, GPIO.OUT)
GPIO.output(14, False)
t1=dt.datetime.now()
t3=0
GPIO.output(02, True)
while t3<1:
t2=dt.datetime.now()
t3=(t2-t1).seconds
GPIO.output(02, False)
t1=dt.datetime.now()
t3=0
GPIO.output(14, True)
while t3<1:
t2=dt.datetime.now()
t3=(t2-t1).seconds
GPIO.output(14, False)
t1=dt.datetime.now()
t3=0
GPIO.output(03, True)
while t3<1:
t2=dt.datetime.now()
t3=(t2-t1).seconds
GPIO.output(03, False)
t1=dt.datetime.now()
t3=0
GPIO.output(04, True)
while t3<1:
t2=dt.datetime.now()
t3=(t2-t1).seconds
GPIO.output(04, False)