-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgpio.py
More file actions
69 lines (47 loc) · 1.43 KB
/
gpio.py
File metadata and controls
69 lines (47 loc) · 1.43 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import Adafruit_BBIO.GPIO as GPIO
import time as t
TIME = 5
TIME_HEATER = 15
GPIO.setup("P8_8",GPIO.OUT)
GPIO.setup("P8_10",GPIO.OUT)
GPIO.setup("P8_12",GPIO.OUT)
GPIO.setup("P9_23",GPIO.OUT)
GPIO.setup("P9_27",GPIO.OUT)
print("GPIO setup successful")
print("P8_08 : Red LED")
print("P8_10 : Green LED")
print("P8_12 : Blue LED")
print("P9_23 : Fan")
print("P9_27 : Heater")
print("**********************************")
print("Testing each pins for High and Low")
print("**********************************")
print("-------------------------")
print("Testing P8_08 : Red LED")
GPIO.output("P8_8",GPIO.HIGH)
print("Check if the Red LED is On")
t.sleep(TIME)
GPIO.output("P8_8",GPIO.LOW)
print("Check if the Red LED is Off")
print("Testing P8_10 : Green LED")
GPIO.output("P8_10",GPIO.HIGH)
print("Check if the Green LED is On")
t.sleep(TIME)
GPIO.output("P8_10",GPIO.LOW)
print("Check if the Green LED is Off")
print("Testing P8_12 : Blue LED")
GPIO.output("P8_12",GPIO.HIGH)
print("Check if the Blue LED is On")
t.sleep(TIME)
GPIO.output("P8_12",GPIO.LOW)
print("Check if the Blue LED is Off")
GPIO.output("P9_23",GPIO.HIGH)
print("Check if the Fan is On")
t.sleep(TIME)
GPIO.output("P9_23",GPIO.LOW)
print("Check if the Fan is Off")
GPIO.output("P9_27",GPIO.HIGH)
print("Check if the Heater is On (this check remains on for"+ TIME_HEATER +"seconds)")
t.sleep(TIME_HEATER)
GPIO.output("P9_27",GPIO.LOW)
print("Check if the Heater is Off")