-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdisplay.py
More file actions
36 lines (31 loc) · 698 Bytes
/
display.py
File metadata and controls
36 lines (31 loc) · 698 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
import socket
import fcntl
import struct
import pyupm_i2clcd as lcd
import time
global lcd
lcd = lcd.Jhd1313m1(0,0x3E,0x62)
lcd.clear()
lcd.setCursor(0,0)
def timer():
lcd.clear()
seconds = 0
while True:
lcd.setCursor(0,0)
lcd.write('Time elapsed:')
lcd.setCursor(1,0)
lcd.write('{} Seconds'.format(seconds))
time.sleep(1)
seconds += 1
def outcome(bool):
lcd.clear()
if bool == 0:
lcd.setColor(255,255,0)
lcd.write('Success!')
else:
lcd.setColor(255,0,0)
lcd.write('Fatal error :( ')
def write(string,red,green,blue):
lcd.clear()
lcd.setColor(red,green,blue)
lcd.write(string)