-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmain.py
320 lines (286 loc) · 29.1 KB
/
main.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
"""
[程序] 1.3寸IPS 240*240 ST7789 驱动程序+时钟显示程序+背景更新程序
[作者] 欢笑与泪滴
[联系]Email:[email protected]
"""
from machine import Pin
from machine import RTC
from machine import SPI
import network
import machine
import time
import socket
import ujson
import _thread
import os
"""
接线示意图
ESP32 -- TFT
5 -- BLK
17 -- DC
16 -- RES
GND -- GND
VCC -- VCC
18 -- SCL
23 -- SDA
"""
class TFT:
#@micropython.viper
def __init__(self):
#WIFI参数设定
self.ssid="填入你的WIFI名称"
self.password="填入你的WIFI密码"
#TFT相关引脚,可以更改
self.bl=Pin(5,Pin.OUT) #显示屏BLK引脚
self.rs=Pin(17,Pin.OUT) #显示屏DC引脚
self.reset=Pin(16,Pin.OUT) #显示屏RES引脚
#软SPI,固定引脚不可更改
self.hspi = SPI(2, baudrate=40000000, polarity=1, sck=Pin(18), mosi=Pin(23))
#WIFI对象
self.wifi = network.WLAN(network.STA_IF)
#文件对象
self.f=open("girl.bin","rb")
self.flush=False
def mywifi(self,status):
#True打开wifi,False关闭wifi
if status==True:
if not self.wifi.isconnected():
print('无法连接网络...')
self.wifi.active(True) #激活WIFI
self.wifi.connect(self.ssid, self.password)
while not self.wifi.isconnected():
pass
print('网络状态:', self.wifi.ifconfig())
else:
self.wifi.disconnect()
#@micropython.viper
def delay_ms(self,time):
for i in range(time):
for j in range(250):
pass
pass
def Lcd_WriteIndex(self,Data):
#向液晶屏写一个8位指令
self.rs.value(0)
self.hspi.write(bytearray([Data]))
self.rs.value(1)
#@micropython.viper
def Lcd_WriteData(self,Data):
#向液晶屏写一个8位数据
self.hspi.write(bytearray([Data]))
#@micropython.viper
def LCD_WriteData_16Bit(self,Data):
#向液晶屏写一个16位数据
self.hspi.write(bytearray([Data>>8]))
self.hspi.write(bytearray([Data&0x0011]))
def Reset(self):
self.reset.value(0)
self.delay_ms(100)
self.reset.value(1)
self.delay_ms(100)
self.bl.value(0)
self.delay_ms(100)
#@micropython.viper
def lcd_initial(self):
#液晶屏初始化
self.Reset()
self.Lcd_WriteIndex(0x11)
self.delay_ms(120)
self.Lcd_WriteIndex(0x36)
self.Lcd_WriteData(0x70)
self.Lcd_WriteIndex(0x3A)
self.Lcd_WriteData(0x05)
self.Lcd_WriteIndex(0xB2)
self.Lcd_WriteData(0x0C)
self.Lcd_WriteData(0x0C)
self.Lcd_WriteData(0x00)
self.Lcd_WriteData(0x33)
self.Lcd_WriteData(0x33)
self.Lcd_WriteIndex(0xB7)
self.Lcd_WriteData(0x35)
self.Lcd_WriteIndex(0xBB)
self.Lcd_WriteData(0x19)
self.Lcd_WriteIndex(0xC0)
self.Lcd_WriteData(0x2C)
self.Lcd_WriteIndex(0xC2)
self.Lcd_WriteData(0x01)
self.Lcd_WriteIndex(0xC3)
self.Lcd_WriteData(0x12)
self.Lcd_WriteIndex(0xC4)
self.Lcd_WriteData(0x20)
self.Lcd_WriteIndex(0xC6)
self.Lcd_WriteData(0x0F)
self.Lcd_WriteIndex(0xD0)
self.Lcd_WriteData(0xA4)
self.Lcd_WriteData(0xA1)
self.Lcd_WriteIndex(0xE0)
self.Lcd_WriteData(0xD0)
self.Lcd_WriteData(0x04)
self.Lcd_WriteData(0x0D)
self.Lcd_WriteData(0x11)
self.Lcd_WriteData(0x13)
self.Lcd_WriteData(0x2B)
self.Lcd_WriteData(0x3F)
self.Lcd_WriteData(0x54)
self.Lcd_WriteData(0x4C)
self.Lcd_WriteData(0x18)
self.Lcd_WriteData(0x0D)
self.Lcd_WriteData(0x0B)
self.Lcd_WriteData(0x1F)
self.Lcd_WriteData(0x23)
self.Lcd_WriteIndex(0xE1)
self.Lcd_WriteData(0xD0)
self.Lcd_WriteData(0x04)
self.Lcd_WriteData(0x0C)
self.Lcd_WriteData(0x11)
self.Lcd_WriteData(0x13)
self.Lcd_WriteData(0x2C)
self.Lcd_WriteData(0x3F)
self.Lcd_WriteData(0x44)
self.Lcd_WriteData(0x51)
self.Lcd_WriteData(0x2F)
self.Lcd_WriteData(0x1F)
self.Lcd_WriteData(0x1F)
self.Lcd_WriteData(0x20)
self.Lcd_WriteData(0x23)
self.Lcd_WriteIndex(0x21)
self.Lcd_WriteIndex(0x11)
self.Lcd_WriteIndex(0x29)
#@micropython.viper
def Lcd_SetRegion(self,x_start,y_start,x_end,y_end):
#设置LCD显示区域
self.Lcd_WriteIndex(0x2a)
self.Lcd_WriteData(0x00)
self.Lcd_WriteData(x_start)
self.Lcd_WriteData(0x00)
self.Lcd_WriteData(x_end)
self.Lcd_WriteIndex(0x2b)
self.Lcd_WriteData(0x00)
self.Lcd_WriteData(y_start)
self.Lcd_WriteData(0x00)
self.Lcd_WriteData(y_end)
self.Lcd_WriteIndex(0x2c)
@micropython.native
def dazimu(self,_x,_y,font):
#时间显示
x=_x
y=_y
self.Lcd_SetRegion(x,y,x+40-1,y+80-1)
r1=range(400)
r2=range(8)
w=self.hspi.write
num=0
for j in r1:
for k in r2:
if font[j]&(0x01<<k):
#self.LCD_WriteData_16Bit(fc)
w(b'\xDE')
w(b'\xFB')
else:
a=num//40
b=num%40
self.f.seek(((_y-1+a)*240+_x+b)*2)
w(self.f.read(1))
w(self.f.read(1))
num+=1
x=40
return x
def showTime(self):
#时钟主程序
#80X80 数字等
font={":":[0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x80,0xFF,0x00,0x00,0x00,0xC0,0xFF,0x00,0x00,0x00,0xC0,0xFF,0x01,0x00,0x00,0xC0,0xFF,0x01,0x00,0x00,0xC0,0xFF,0x01,0x00,0x00,0xC0,0xFF,0x01,0x00,0x00,0xC0,0xFF,0x00,0x00,0x00,0x80,0xFF,0x00,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x80,0x7F,0x00,0x00,0x00,0xC0,0xFF,0x00,0x00,0x00,0xC0,0xFF,0x01,0x00,0x00,0xC0,0xFF,0x01,0x00,0x00,0xC0,0xFF,0x01,0x00,0x00,0xC0,0xFF,0x01,0x00,0x00,0xC0,0xFF,0x01,0x00,0x00,0xC0,0xFF,0x00,0x00,0x00,0x80,0x7F,0x00,0x00,0x00,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00],0:[0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xFF,0x03,0x00,0x00,0xE0,0xFF,0x0F,0x00,0x00,0xF8,0xFF,0x3F,0x00,0x00,0xFC,0xFF,0x7F,0x00,0x00,0xFE,0xFF,0xFF,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x80,0xFF,0xFF,0xFF,0x01,0x80,0xFF,0x83,0xFF,0x03,0xC0,0xFF,0x01,0xFF,0x03,0xC0,0xFF,0x00,0xFE,0x07,0xE0,0x7F,0x00,0xFC,0x07,0xE0,0x3F,0x00,0xF8,0x0F,0xF0,0x3F,0x00,0xF8,0x0F,0xF0,0x1F,0x00,0xF8,0x0F,0xF0,0x1F,0x00,0xF0,0x0F,0xF0,0x1F,0x00,0xF0,0x1F,0xF8,0x0F,0x00,0xF0,0x1F,0xF8,0x0F,0x00,0xE0,0x1F,0xF8,0x0F,0x00,0xE0,0x1F,0xF8,0x0F,0x00,0xE0,0x1F,0xF8,0x0F,0x00,0xE0,0x1F,0xF8,0x07,0x00,0xE0,0x1F,0xF8,0x07,0x00,0xE0,0x1F,0xF8,0x07,0x00,0xE0,0x1F,0xF8,0x07,0x00,0xE0,0x1F,0xF8,0x07,0x00,0xE0,0x1F,0xF8,0x07,0x00,0xE0,0x1F,0xF8,0x07,0x00,0xE0,0x1F,0xF8,0x07,0x00,0xE0,0x1F,0xF8,0x07,0x00,0xE0,0x1F,0xF8,0x07,0x00,0xE0,0x1F,0xF8,0x07,0x00,0xE0,0x1F,0xF8,0x07,0x00,0xE0,0x1F,0xF8,0x07,0x00,0xE0,0x1F,0xF8,0x07,0x00,0xE0,0x1F,0xF8,0x0F,0x00,0xE0,0x1F,0xF8,0x0F,0x00,0xE0,0x1F,0xF8,0x0F,0x00,0xF0,0x1F,0xF0,0x0F,0x00,0xF0,0x1F,0xF0,0x1F,0x00,0xF0,0x0F,0xF0,0x1F,0x00,0xF0,0x0F,0xF0,0x1F,0x00,0xF8,0x0F,0xE0,0x3F,0x00,0xF8,0x0F,0xE0,0x3F,0x00,0xFC,0x07,0xE0,0x7F,0x00,0xFC,0x07,0xC0,0xFF,0x00,0xFE,0x07,0xC0,0xFF,0x01,0xFF,0x03,0x80,0xFF,0xC7,0xFF,0x03,0x00,0xFF,0xFF,0xFF,0x01,0x00,0xFF,0xFF,0xFF,0x00,0x00,0xFE,0xFF,0xFF,0x00,0x00,0xFC,0xFF,0x7F,0x00,0x00,0xF0,0xFF,0x1F,0x00,0x00,0xC0,0xFF,0x0F,0x00,0x00,0x00,0xFF,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00],1:[0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x01,0x00,0x00,0x00,0xF8,0x01,0x00,0x00,0x00,0xFC,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFF,0x01,0x00,0x00,0x80,0xFF,0x01,0x00,0x00,0xC0,0xFF,0x01,0x00,0x00,0xE0,0xFF,0x01,0x00,0x00,0xF0,0xFF,0x01,0x00,0x00,0xF8,0xFF,0x01,0x00,0x00,0xFC,0xFF,0x01,0x00,0x00,0xFF,0xFF,0x01,0x00,0x80,0xFF,0xFF,0x01,0x00,0x80,0xFF,0xFF,0x01,0x00,0x80,0xFF,0xFE,0x01,0x00,0x80,0x7F,0xFE,0x01,0x00,0x80,0x1F,0xFE,0x01,0x00,0x80,0x0F,0xFE,0x01,0x00,0x80,0x03,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00],2:[0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xFF,0x0F,0x00,0x00,0xF8,0xFF,0x3F,0x00,0x00,0xFC,0xFF,0x7F,0x00,0x00,0xFE,0xFF,0xFF,0x00,0x00,0xFF,0xFF,0xFF,0x01,0x80,0xFF,0xFF,0xFF,0x03,0xC0,0xFF,0xFF,0xFF,0x07,0xE0,0xFF,0x83,0xFF,0x07,0xE0,0xFF,0x00,0xFE,0x07,0xF0,0x3F,0x00,0xFC,0x0F,0xF0,0x1F,0x00,0xF8,0x0F,0xF8,0x0F,0x00,0xF8,0x0F,0xF8,0x0F,0x00,0xF8,0x0F,0xF8,0x07,0x00,0xF0,0x0F,0xF8,0x07,0x00,0xF0,0x0F,0x00,0x00,0x00,0xF0,0x0F,0x00,0x00,0x00,0xF8,0x0F,0x00,0x00,0x00,0xF8,0x0F,0x00,0x00,0x00,0xF8,0x0F,0x00,0x00,0x00,0xFC,0x07,0x00,0x00,0x00,0xFC,0x07,0x00,0x00,0x00,0xFE,0x07,0x00,0x00,0x00,0xFE,0x03,0x00,0x00,0x00,0xFF,0x03,0x00,0x00,0x00,0xFF,0x01,0x00,0x00,0x80,0xFF,0x01,0x00,0x00,0xC0,0xFF,0x00,0x00,0x00,0xC0,0x7F,0x00,0x00,0x00,0xE0,0x7F,0x00,0x00,0x00,0xF0,0x3F,0x00,0x00,0x00,0xF8,0x1F,0x00,0x00,0x00,0xF8,0x1F,0x00,0x00,0x00,0xFC,0x0F,0x00,0x00,0x00,0xFE,0x07,0x00,0x00,0x00,0xFF,0x03,0x00,0x00,0x80,0xFF,0x03,0x00,0x00,0x80,0xFF,0x01,0x00,0x00,0xC0,0xFF,0x00,0x00,0x00,0xE0,0x7F,0x00,0x00,0x00,0xF0,0x3F,0x00,0x00,0x00,0xF8,0x3F,0x00,0x00,0x00,0xFC,0x1F,0x00,0x00,0x00,0xFE,0x0F,0x00,0x00,0x00,0xFF,0x07,0x00,0x00,0x80,0xFF,0x03,0x00,0x00,0xC0,0xFF,0x01,0x00,0x00,0xC0,0xFF,0x00,0x00,0x00,0xE0,0xFF,0x00,0x00,0x00,0xF0,0xFF,0xFF,0xFF,0x1F,0xF0,0xFF,0xFF,0xFF,0x1F,0xF0,0xFF,0xFF,0xFF,0x1F,0xF0,0xFF,0xFF,0xFF,0x1F,0xF0,0xFF,0xFF,0xFF,0x1F,0xF0,0xFF,0xFF,0xFF,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00],3:[0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xFF,0x07,0x00,0x00,0xE0,0xFF,0x1F,0x00,0x00,0xF8,0xFF,0x7F,0x00,0x00,0xFC,0xFF,0xFF,0x00,0x00,0xFE,0xFF,0xFF,0x01,0x00,0xFF,0xFF,0xFF,0x03,0x80,0xFF,0xE7,0xFF,0x07,0x80,0xFF,0x01,0xFF,0x07,0xC0,0x7F,0x00,0xFE,0x0F,0xE0,0x3F,0x00,0xFC,0x0F,0xE0,0x3F,0x00,0xF8,0x0F,0xE0,0x1F,0x00,0xF8,0x0F,0xF0,0x1F,0x00,0xF0,0x0F,0xF0,0x0F,0x00,0xF0,0x0F,0xF0,0x0F,0x00,0xF0,0x0F,0x00,0x00,0x00,0xF0,0x0F,0x00,0x00,0x00,0xF8,0x0F,0x00,0x00,0x00,0xF8,0x0F,0x00,0x00,0x00,0xFC,0x07,0x00,0x00,0x00,0xFC,0x07,0x00,0x00,0x00,0xFE,0x07,0x00,0x00,0x80,0xFF,0x03,0x00,0x00,0xE0,0xFF,0x01,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0xFF,0x7F,0x00,0x00,0x00,0xFF,0x3F,0x00,0x00,0x00,0xFF,0x7F,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0xFF,0xFF,0x01,0x00,0x00,0xF0,0xFF,0x03,0x00,0x00,0x80,0xFF,0x07,0x00,0x00,0x00,0xFE,0x0F,0x00,0x00,0x00,0xFC,0x0F,0x00,0x00,0x00,0xF8,0x0F,0x00,0x00,0x00,0xF8,0x1F,0x00,0x00,0x00,0xF0,0x1F,0x00,0x00,0x00,0xF0,0x1F,0x00,0x00,0x00,0xF0,0x1F,0x00,0x00,0x00,0xF0,0x1F,0xE0,0x07,0x00,0xF0,0x1F,0xF8,0x07,0x00,0xF0,0x1F,0xF8,0x0F,0x00,0xF0,0x1F,0xF8,0x0F,0x00,0xF0,0x1F,0xF0,0x1F,0x00,0xF8,0x0F,0xF0,0x3F,0x00,0xFC,0x0F,0xF0,0x7F,0x00,0xFC,0x0F,0xE0,0xFF,0x00,0xFF,0x07,0xE0,0xFF,0x83,0xFF,0x07,0xC0,0xFF,0xFF,0xFF,0x03,0x80,0xFF,0xFF,0xFF,0x01,0x00,0xFF,0xFF,0xFF,0x00,0x00,0xFE,0xFF,0x7F,0x00,0x00,0xFC,0xFF,0x3F,0x00,0x00,0xF0,0xFF,0x0F,0x00,0x00,0x80,0xFF,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00],4:[0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFF,0x01,0x00,0x00,0x00,0xFF,0x01,0x00,0x00,0x80,0xFF,0x01,0x00,0x00,0xC0,0xFF,0x01,0x00,0x00,0xE0,0xFF,0x01,0x00,0x00,0xE0,0xFF,0x01,0x00,0x00,0xF0,0xFF,0x01,0x00,0x00,0xF8,0xFF,0x01,0x00,0x00,0xF8,0xFF,0x01,0x00,0x00,0xFC,0xFF,0x01,0x00,0x00,0xFE,0xFF,0x01,0x00,0x00,0xFE,0xFF,0x01,0x00,0x00,0xFF,0xFF,0x01,0x00,0x80,0xFF,0xFF,0x01,0x00,0x80,0xFF,0xFE,0x01,0x00,0xC0,0x7F,0xFE,0x01,0x00,0xE0,0x7F,0xFE,0x01,0x00,0xF0,0x3F,0xFE,0x01,0x00,0xF0,0x1F,0xFE,0x01,0x00,0xF8,0x1F,0xFE,0x01,0x00,0xFC,0x0F,0xFE,0x01,0x00,0xFC,0x07,0xFE,0x01,0x00,0xFE,0x03,0xFE,0x01,0x00,0xFF,0x03,0xFE,0x01,0x00,0xFF,0x01,0xFE,0x01,0x80,0xFF,0x00,0xFE,0x01,0xC0,0xFF,0x00,0xFE,0x01,0xC0,0x7F,0x00,0xFE,0x01,0xE0,0x3F,0x00,0xFE,0x01,0xF0,0x1F,0x00,0xFE,0x01,0xF8,0x1F,0x00,0xFE,0x01,0xF8,0x0F,0x00,0xFE,0x01,0xFC,0x07,0x00,0xFE,0x01,0xFE,0x07,0x00,0xFE,0x01,0xFE,0xFF,0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00],5:[0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFF,0xFF,0x07,0x00,0xFF,0xFF,0xFF,0x07,0x00,0xFF,0xFF,0xFF,0x07,0x00,0xFF,0xFF,0xFF,0x07,0x00,0xFF,0xFF,0xFF,0x07,0x80,0xFF,0xFF,0xFF,0x07,0x80,0xFF,0xFF,0xFF,0x07,0x80,0x7F,0x00,0x00,0x00,0x80,0x7F,0x00,0x00,0x00,0x80,0x7F,0x00,0x00,0x00,0xC0,0x3F,0x00,0x00,0x00,0xC0,0x3F,0x00,0x00,0x00,0xC0,0x3F,0x00,0x00,0x00,0xC0,0x3F,0x00,0x00,0x00,0xC0,0x3F,0x00,0x00,0x00,0xE0,0x1F,0x00,0x00,0x00,0xE0,0x1F,0x00,0x00,0x00,0xE0,0xDF,0xFF,0x01,0x00,0xE0,0xFF,0xFF,0x0F,0x00,0xF0,0xFF,0xFF,0x3F,0x00,0xF0,0xFF,0xFF,0xFF,0x00,0xF0,0xFF,0xFF,0xFF,0x01,0xF0,0xFF,0xFF,0xFF,0x01,0xF0,0xFF,0xF3,0xFF,0x03,0xF8,0x3F,0x80,0xFF,0x07,0xF8,0x1F,0x00,0xFF,0x07,0xF8,0x07,0x00,0xFC,0x0F,0xF8,0x07,0x00,0xFC,0x0F,0x00,0x00,0x00,0xF8,0x0F,0x00,0x00,0x00,0xF0,0x1F,0x00,0x00,0x00,0xF0,0x1F,0x00,0x00,0x00,0xF0,0x1F,0x00,0x00,0x00,0xF0,0x1F,0x00,0x00,0x00,0xF0,0x1F,0x00,0x00,0x00,0xE0,0x1F,0x00,0x00,0x00,0xE0,0x1F,0x00,0x00,0x00,0xF0,0x1F,0x00,0x00,0x00,0xF0,0x1F,0xF0,0x01,0x00,0xF0,0x1F,0xFE,0x01,0x00,0xF0,0x1F,0xFE,0x03,0x00,0xF8,0x0F,0xFC,0x03,0x00,0xF8,0x0F,0xFC,0x07,0x00,0xFC,0x0F,0xFC,0x07,0x00,0xFE,0x0F,0xFC,0x0F,0x00,0xFF,0x07,0xF8,0x1F,0x80,0xFF,0x07,0xF8,0x7F,0xE0,0xFF,0x03,0xF0,0xFF,0xFF,0xFF,0x03,0xE0,0xFF,0xFF,0xFF,0x01,0xC0,0xFF,0xFF,0xFF,0x00,0x80,0xFF,0xFF,0x3F,0x00,0x00,0xFF,0xFF,0x1F,0x00,0x00,0xFC,0xFF,0x07,0x00,0x00,0xE0,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00],6:[0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x3F,0x00,0x00,0x00,0xE0,0x3F,0x00,0x00,0x00,0xF0,0x3F,0x00,0x00,0x00,0xF8,0x1F,0x00,0x00,0x00,0xF8,0x1F,0x00,0x00,0x00,0xFC,0x0F,0x00,0x00,0x00,0xFE,0x07,0x00,0x00,0x00,0xFE,0x07,0x00,0x00,0x00,0xFF,0x03,0x00,0x00,0x00,0xFF,0x01,0x00,0x00,0x80,0xFF,0x01,0x00,0x00,0xC0,0xFF,0x00,0x00,0x00,0xC0,0x7F,0x00,0x00,0x00,0xE0,0x7F,0x00,0x00,0x00,0xF0,0x3F,0x00,0x00,0x00,0xF0,0x3F,0x00,0x00,0x00,0xF8,0x1F,0x00,0x00,0x00,0xFC,0x0F,0x00,0x00,0x00,0xFC,0x0F,0x00,0x00,0x00,0xFE,0x07,0x00,0x00,0x00,0xFE,0xFF,0x3F,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x80,0xFF,0xFF,0xFF,0x01,0x80,0xFF,0xFF,0xFF,0x07,0xC0,0xFF,0xFF,0xFF,0x0F,0xC0,0xFF,0xFF,0xFF,0x0F,0xE0,0xFF,0x03,0xFE,0x1F,0xE0,0xFF,0x00,0xF8,0x3F,0xF0,0x7F,0x00,0xF0,0x3F,0xF0,0x3F,0x00,0xE0,0x7F,0xF0,0x1F,0x00,0xC0,0x7F,0xF0,0x1F,0x00,0xC0,0x7F,0xF8,0x0F,0x00,0xC0,0x7F,0xF8,0x0F,0x00,0x80,0x7F,0xF8,0x0F,0x00,0x80,0x7F,0xF8,0x0F,0x00,0x80,0xFF,0xF8,0x0F,0x00,0x80,0xFF,0xF8,0x0F,0x00,0x80,0xFF,0xF8,0x0F,0x00,0x80,0x7F,0xF8,0x0F,0x00,0x80,0x7F,0xF8,0x0F,0x00,0xC0,0x7F,0xF8,0x0F,0x00,0xC0,0x7F,0xF0,0x1F,0x00,0xC0,0x7F,0xF0,0x1F,0x00,0xE0,0x7F,0xF0,0x3F,0x00,0xE0,0x3F,0xE0,0x7F,0x00,0xF0,0x3F,0xE0,0xFF,0x00,0xF8,0x1F,0xE0,0xFF,0x03,0xFE,0x1F,0xC0,0xFF,0xFF,0xFF,0x0F,0x80,0xFF,0xFF,0xFF,0x07,0x00,0xFF,0xFF,0xFF,0x03,0x00,0xFE,0xFF,0xFF,0x01,0x00,0xFC,0xFF,0xFF,0x00,0x00,0xF0,0xFF,0x3F,0x00,0x00,0x80,0xFF,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00],7:[0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0xFF,0xFF,0xFF,0x3F,0xF8,0xFF,0xFF,0xFF,0x3F,0xF8,0xFF,0xFF,0xFF,0x3F,0xF8,0xFF,0xFF,0xFF,0x3F,0xF8,0xFF,0xFF,0xFF,0x3F,0xF8,0xFF,0xFF,0xFF,0x3F,0xF8,0xFF,0xFF,0xFF,0x3F,0x00,0x00,0x00,0xE0,0x3F,0x00,0x00,0x00,0xF0,0x1F,0x00,0x00,0x00,0xF0,0x0F,0x00,0x00,0x00,0xF8,0x0F,0x00,0x00,0x00,0xFC,0x07,0x00,0x00,0x00,0xFC,0x07,0x00,0x00,0x00,0xFE,0x03,0x00,0x00,0x00,0xFE,0x03,0x00,0x00,0x00,0xFF,0x01,0x00,0x00,0x00,0xFF,0x01,0x00,0x00,0x80,0xFF,0x00,0x00,0x00,0x80,0xFF,0x00,0x00,0x00,0xC0,0x7F,0x00,0x00,0x00,0xC0,0x7F,0x00,0x00,0x00,0xE0,0x3F,0x00,0x00,0x00,0xE0,0x3F,0x00,0x00,0x00,0xF0,0x1F,0x00,0x00,0x00,0xF0,0x1F,0x00,0x00,0x00,0xF0,0x0F,0x00,0x00,0x00,0xF8,0x0F,0x00,0x00,0x00,0xF8,0x07,0x00,0x00,0x00,0xFC,0x07,0x00,0x00,0x00,0xFC,0x03,0x00,0x00,0x00,0xFE,0x03,0x00,0x00,0x00,0xFE,0x03,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0x00,0xFF,0x01,0x00,0x00,0x00,0xFF,0x01,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x80,0xFF,0x00,0x00,0x00,0x80,0xFF,0x00,0x00,0x00,0xC0,0x7F,0x00,0x00,0x00,0xC0,0x7F,0x00,0x00,0x00,0xC0,0x7F,0x00,0x00,0x00,0xE0,0x3F,0x00,0x00,0x00,0xE0,0x3F,0x00,0x00,0x00,0xE0,0x3F,0x00,0x00,0x00,0xE0,0x1F,0x00,0x00,0x00,0xF0,0x1F,0x00,0x00,0x00,0xF0,0x1F,0x00,0x00,0x00,0xF0,0x1F,0x00,0x00,0x00,0xF8,0x0F,0x00,0x00,0x00,0xF8,0x0F,0x00,0x00,0x00,0xF8,0x0F,0x00,0x00,0x00,0xF8,0x0F,0x00,0x00,0x00,0xF8,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00],8:[0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xFF,0x01,0x00,0x00,0xF8,0xFF,0x0F,0x00,0x00,0xFE,0xFF,0x3F,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x80,0xFF,0xFF,0xFF,0x01,0x80,0xFF,0xFF,0xFF,0x03,0xC0,0xFF,0xFF,0xFF,0x03,0xE0,0xFF,0x00,0xFF,0x07,0xE0,0x3F,0x00,0xFE,0x07,0xF0,0x1F,0x00,0xFC,0x07,0xF0,0x1F,0x00,0xF8,0x0F,0xF0,0x0F,0x00,0xF8,0x0F,0xF0,0x0F,0x00,0xF8,0x0F,0xF0,0x0F,0x00,0xF0,0x0F,0xF0,0x0F,0x00,0xF0,0x0F,0xF0,0x0F,0x00,0xF8,0x0F,0xF0,0x0F,0x00,0xF8,0x0F,0xF0,0x0F,0x00,0xF8,0x07,0xF0,0x1F,0x00,0xFC,0x07,0xE0,0x3F,0x00,0xFE,0x07,0xE0,0x7F,0x00,0xFF,0x03,0xE0,0xFF,0x80,0xFF,0x03,0xC0,0xFF,0xFF,0xFF,0x01,0x80,0xFF,0xFF,0xFF,0x00,0x00,0xFF,0xFF,0x7F,0x00,0x00,0xFE,0xFF,0x3F,0x00,0x00,0xFF,0xFF,0x7F,0x00,0x80,0xFF,0xFF,0xFF,0x01,0xC0,0xFF,0xFF,0xFF,0x03,0xE0,0xFF,0xFF,0xFF,0x07,0xF0,0xFF,0x81,0xFF,0x0F,0xF0,0x7F,0x00,0xFE,0x0F,0xF8,0x1F,0x00,0xFC,0x1F,0xF8,0x0F,0x00,0xF8,0x1F,0xF8,0x0F,0x00,0xF0,0x1F,0xFC,0x07,0x00,0xE0,0x1F,0xFC,0x07,0x00,0xE0,0x1F,0xFC,0x07,0x00,0xE0,0x1F,0xFC,0x03,0x00,0xE0,0x1F,0xFC,0x07,0x00,0xE0,0x1F,0xFC,0x07,0x00,0xE0,0x1F,0xFC,0x07,0x00,0xE0,0x1F,0xFC,0x07,0x00,0xF0,0x1F,0xFC,0x07,0x00,0xF0,0x1F,0xF8,0x0F,0x00,0xF8,0x1F,0xF8,0x1F,0x00,0xF8,0x1F,0xF8,0x3F,0x00,0xFE,0x0F,0xF0,0xFF,0x80,0xFF,0x0F,0xF0,0xFF,0xFF,0xFF,0x07,0xE0,0xFF,0xFF,0xFF,0x03,0xC0,0xFF,0xFF,0xFF,0x01,0x80,0xFF,0xFF,0xFF,0x01,0x00,0xFF,0xFF,0x7F,0x00,0x00,0xFC,0xFF,0x3F,0x00,0x00,0xE0,0xFF,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00],9:[0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xFF,0x03,0x00,0x00,0xF8,0xFF,0x0F,0x00,0x00,0xFE,0xFF,0x3F,0x00,0x00,0xFF,0xFF,0x7F,0x00,0x80,0xFF,0xFF,0xFF,0x00,0xC0,0xFF,0xFF,0xFF,0x01,0xE0,0xFF,0xFF,0xFF,0x03,0xF0,0xFF,0xC1,0xFF,0x07,0xF0,0x7F,0x00,0xFF,0x07,0xF8,0x3F,0x00,0xFE,0x0F,0xF8,0x1F,0x00,0xFC,0x0F,0xFC,0x0F,0x00,0xF8,0x0F,0xFC,0x0F,0x00,0xF8,0x1F,0xFC,0x07,0x00,0xF0,0x1F,0xFC,0x07,0x00,0xF0,0x1F,0xFC,0x03,0x00,0xF0,0x1F,0xFC,0x03,0x00,0xF0,0x1F,0xFC,0x03,0x00,0xF0,0x1F,0xFC,0x03,0x00,0xF0,0x1F,0xFC,0x03,0x00,0xF0,0x1F,0xFC,0x03,0x00,0xF8,0x1F,0xFC,0x07,0x00,0xF8,0x0F,0xFC,0x07,0x00,0xF8,0x0F,0xFC,0x07,0x00,0xFC,0x0F,0xFC,0x0F,0x00,0xFE,0x07,0xF8,0x1F,0x00,0xFF,0x07,0xF8,0x3F,0x80,0xFF,0x07,0xF8,0x7F,0xC0,0xFF,0x03,0xF0,0xFF,0xFF,0xFF,0x03,0xE0,0xFF,0xFF,0xFF,0x01,0xC0,0xFF,0xFF,0xFF,0x01,0x80,0xFF,0xFF,0xFF,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0xFC,0xFF,0x7F,0x00,0x00,0xC0,0xFF,0x7F,0x00,0x00,0x00,0xF0,0x3F,0x00,0x00,0x00,0xF8,0x1F,0x00,0x00,0x00,0xF8,0x1F,0x00,0x00,0x00,0xF8,0x0F,0x00,0x00,0x00,0xFC,0x0F,0x00,0x00,0x00,0xFE,0x07,0x00,0x00,0x00,0xFE,0x07,0x00,0x00,0x00,0xFF,0x03,0x00,0x00,0x00,0xFF,0x01,0x00,0x00,0x80,0xFF,0x01,0x00,0x00,0x80,0xFF,0x00,0x00,0x00,0xC0,0xFF,0x00,0x00,0x00,0xC0,0x7F,0x00,0x00,0x00,0xE0,0x7F,0x00,0x00,0x00,0xE0,0x3F,0x00,0x00,0x00,0xF0,0x1F,0x00,0x00,0x00,0xF8,0x1F,0x00,0x00,0x00,0xF8,0x0F,0x00,0x00,0x00,0xFC,0x0F,0x00,0x00,0x00,0xFC,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}
#连接服务器更新时间
self.mywifi(True)
target=('quan.suning.com',80)
client=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
client.connect(target)
client.send(b'GET /getSysTime.do HTTP/1.1\r\nHost:quan.suning.com\r\n\r\n')
temp=ujson.loads(client.recv(4096).decode().split("\r\n\r\n")[1])["sysTime1"]
_time=(int(temp[0:4]),int(temp[4:6]),int(temp[6:8]),0,int(temp[8:10]),int(temp[10:12]),int(temp[12:14]),0)
rtc = RTC()
rtc.datetime(_time)
#rtc.datetime((2020, 7, 5, 1, 00, 00, 00, 00))
#self.mywifi(False)
last={"_h1":"","_h2":"","_m1":"","_m2":"","_s1":"","_s2":"","first":True}
while True:
#获取时间,并格式化
now=rtc.datetime()
_h=now[4]
_m=now[5]
_s=now[6]
_h1=_h//10
_h2=_h%10
_m1=_m//10
_m2=_m%10
_s1=_s//10
_s2=_s%10
#设置时间初始显示位置 #25
x=25
y=120
if self.flush==True:
#时钟背景更新,刷新屏幕
self.showPic()
last={"_h1":"","_h2":"","_m1":"","_m2":"","_s1":"","_s2":"","first":True}
last["first"]=True
self.flush=False
#数据有变化才更新,提高刷新速度
if last["_h1"]!=_h1:
self.dazimu(x,y,font[_h1])
last["_h1"]=_h1
if last["_h2"]!=_h2:
self.dazimu(x+40,y,font[_h2])
last["_h2"]=_h2
if last["first"]==True:
self.dazimu(x+40+40,y-10,font[":"])
last["first"]=False
if last["_m1"]!=_m1:
self.dazimu(x+40+40+40,y,font[_m1])
last["_m1"]=_m1
if last["_m2"]!=_m2:
self.dazimu(x+40+40+40+40,y,font[_m2])
last["_m2"]=_m2
@micropython.native
def showPic(self):
#图片显示
self.Lcd_SetRegion(0,0,0+240-1,0+240-1)
r1=range(240)
r2=range(240)
w=self.hspi.write
for j in r1:
for k in r2:
w(self.f.read(1))
w(self.f.read(1))
def updatePic(file,num):
##背景更新线程,socket监听
ADDR = ("0.0.0.0",1024)
tcpSerSock = socket.socket()
tcpSerSock.bind(ADDR)
tcpSerSock.listen(5)
while True:
print('waiting for connection...')
tcpCliSock, addr = tcpSerSock.accept()
print('...connnecting from:', addr)
pos=0
with open("_girl.bin","wb") as f:
while True:
f.write(tcpCliSock.recv(480))
tcpCliSock.send(b"success")
pos+=480
if pos>=240*240*2:
break
tcpCliSock.close()
print("update success!")
file.f.close()
os.remove("girl.bin")
os.rename("_girl.bin","girl.bin")
file.f=open("girl.bin","rb")
file.flush=True
#主程序
t=TFT()
t.bl.value(0)
for i in range(2):#必须运行两次,不知道为什么
t.lcd_initial()
_thread.start_new_thread(updatePic,(t,1)) #多线程
t.showPic()
t.bl.value(1)
t.showTime()