-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmatrix13_E.py
59 lines (41 loc) · 1.18 KB
/
matrix13_E.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
57
58
59
import max7219.led as led
from random import randint
import time
import os
import csv
import json
matrix = led.matrix(cascaded = 4)
# matrix = led.matrix()
matrix.brightness(0)
matrix.orientation(90)
prompt = "\nINFO: "
prompt += "\nGebe 'quit' ein zum Beenden !"
active = True
while active:
message = (prompt)
if message == 'quit':
break
else:
temp = os.system ('/home/pi/E3dcGui/S10history/./S10history --brief |grep Day-CSV >daye3dc.csv')
filename = '/home/pi/daye3dc.csv'
with open(filename) as f:
reader = csv.reader(f,delimiter=';')
header_row = next(reader)
# for index, column_header in enumerate(header_row):
battin =[]
for row in reader:
battin.append(row[3])
print(row)
t = (time.strftime("%H:%M Uhr"))
matrix.show_message(str(t))
time.sleep(1)
matrix.clear()
matrix.show_message(str(row[3].title()) +" %"+" AKKU")
matrix.clear()
time.sleep(1)
matrix.clear()
solarinfo = row
filename = 'solarinfo.json'
with open(filename, 'w') as f_obj:
json.dump(solarinfo, f_obj)
time.sleep(60)