forked from caternuson/rpi-weather
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplay.py
executable file
·38 lines (32 loc) · 911 Bytes
/
play.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
import time
import httplib
import sys
import json
import ConfigParser
from rpi_weather import RpiWeather
from led8x8icons import LED8x8ICONS
display = RpiWeather()
#-------------------------------------------------------------------------------
# M A I N
#-------------------------------------------------------------------------------
if __name__ == "__main__":
BITMAP = [
[0, 0, 0, 1, 1, 0, 0, 0,],
[0, 0, 1, 0, 0, 1, 0, 0,],
[0, 1, 0, 0, 1, 0, 0, 0,],
[1, 0, 0, 1, 0, 0, 1, 0,],
[1, 0, 0, 1, 0, 0, 0, 0,],
[0, 1, 0, 0, 1, 0, 0, 0,],
[0, 0, 1, 0, 0, 1, 0, 0,],
[0, 0, 0, 1, 1, 0, 0, 0,],
]
value = 0
for y,row in enumerate(BITMAP):
row_byte = 0
for x,bit in enumerate(row):
row_byte += bit<<x
value += row_byte<<(8*y)
print '0x'+format(value,'02x')
#display.clear_disp(0)
#display.disp_temp(97)
#display.scroll_raw64(LED8x8ICONS['RAIN'], 0)