-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtestnokia.py
56 lines (45 loc) · 1.06 KB
/
testnokia.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
55
56
#!/usr/bin/env python
import PCD8544_BBB as pc
import sys
import time
import Adafruit_BBIO.GPIO as GPIO
CE_0="P9_11" #3
CE_1="P9_13" #6
CE_2="P9_15" #1
GPIO.setup(CE_0, GPIO.OUT)
GPIO.setup(CE_1, GPIO.OUT)
GPIO.setup(CE_2, GPIO.OUT)
pc.init()
GPIO.output(CE_0, GPIO.LOW)
GPIO.output(CE_1, GPIO.LOW)
GPIO.output(CE_2, GPIO.LOW)
pc.screenInit()
GPIO.output(CE_0, GPIO.HIGH)
GPIO.output(CE_1, GPIO.HIGH)
GPIO.output(CE_2, GPIO.HIGH)
GPIO.output(CE_0, GPIO.LOW)
pc.set_contrast(160)
GPIO.output(CE_0, GPIO.HIGH)
GPIO.output(CE_1, GPIO.LOW)
pc.set_contrast(170)
GPIO.output(CE_1, GPIO.HIGH)
GPIO.output(CE_2, GPIO.LOW)
pc.set_contrast(180)
GPIO.output(CE_2, GPIO.HIGH)
raw_input("sdf")
while True:
GPIO.output(CE_0, GPIO.LOW)
time.sleep(0.1)
pc.text("LCD 0")
time.sleep(0.1)
GPIO.output(CE_0, GPIO.HIGH)
GPIO.output(CE_1, GPIO.LOW)
time.sleep(0.1)
pc.text("LCD 1")
time.sleep(0.1)
GPIO.output(CE_1, GPIO.HIGH)
GPIO.output(CE_2, GPIO.LOW)
time.sleep(0.1)
pc.text("LCD 2")
time.sleep(0.1)
GPIO.output(CE_2, GPIO.HIGH)