forked from ibanezmatt13/Paddy_Power
-
Notifications
You must be signed in to change notification settings - Fork 0
/
motor_2.py
34 lines (31 loc) · 1.04 KB
/
motor_2.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
# This scrip runs the motor out and then back in again by closing relay output 0
import piface.pfio as pfio # Import PiFace
from time import sleep
pfio.init() # initialise PiFace # Comment out if using as nested script
for x in range (0, 5): # loop x number of times
pfio.digital_write (0,1) # motor out
print "button pressed - motor out"
sleep (1) # hold time
pfio.digital_write (0,0) # release button
#print "released"
#sleep (3) # wait time
#print "running"
#pfio.digital_write (0,1) # motor stop
#print "button pressed - motor stopped"
#sleep (1) # hold time
#pfio.digital_write (0,0) # release button
#print "move in complete waiting"
#sleep (10) # in dead waiting
#print "waiting"
#pfio.digital_write (0,1) # motor in
#print "button pressed - motor in"
#sleep (1) # hold time
#pfio.digital_write (0,0) # release button
#print "released"
#sleep (4) # wait time
#print "running"
#pfio.digital_write (0,1) # motor stop
#print "button pressed - motor stopped"
#sleep (1) # hold time
#pfio.digital_write (0,0) # release button
#print "move out complete"