提交新版本
BIN
PC上位机/1.png
Normal file
|
After Width: | Height: | Size: 9.8 KiB |
BIN
PC上位机/2.png
Normal file
|
After Width: | Height: | Size: 140 KiB |
90
README.md
Normal file
@ -0,0 +1,90 @@
|
||||
### 请尊重开源协议,谢谢!!!!
|
||||
# 基于esp8266+0.96oled的气象站桌面时钟
|
||||
|
||||
## 关于固件版本信息
|
||||
* v1 接口将在2021.12.30日后失效在次之前是能用的
|
||||
* v2 新接口 请勿使用,发现致命问题,接口变化没有改源代码。
|
||||
* v3 1.修复了图标显示问题,2.删除了ota功能(空间有限 无法提供足够的ota空间 请保留rx tx 复用升级是没有问题的)3.优化了变量空间使其更稳定 4.修复配网重置bug(需要升级配网库)
|
||||
* v3b:该固件与v3核心部分一致,为哔哩哔哩up主专用固件,删除了pm2.5显示,增加了哔哩哔哩粉丝显示,本来想做负一屏的可惜i2c刷新太慢了动画不流畅,直接刷新太过突兀只能牺牲pm2.5了,由于删除了一个https请求,整体会更加稳定,更不容易发生32位处理器处理溢出问题。
|
||||
* v4 增加对pc性能显示,其他功能不变,需要使用上位机和aida64,采用pc请求气象站方式,大幅减少因串口通信或建立web通信所需要的性能损失。
|
||||
* v4a 无更新任何功能 配网库升级 修复了臃肿ui(例如miui)和ios扫描出WiFi点击不弹出密码框!(源码更新最新配网库就可以)
|
||||
* v5 删除了开机动画,使得开机速度大幅优化,去除了动态获取天气改为半小时更新一次,修复了正常联网某些设备会搜索出一个乱码的WiFi(源码请先更新配网库)
|
||||
|
||||
|
||||
|
||||
# v4固件视频: https://www.bilibili.com/video/BV1N54y1B7WW/
|
||||
# 视频:https://www.bilibili.com/video/BV1WC4y1h7k4/
|
||||
# 量产版视频: https://www.bilibili.com/video/BV1T54y1S7PU/
|
||||

|
||||
|
||||
|
||||
### 公共天气API_KEY:
|
||||
* e98f6584cc5c4430a084904315907cf8
|
||||
* c7d69f5c001b40ca83a9d2fd90ca509b
|
||||
* 7deed586fbdf4a598ddcaa73c4c1580d
|
||||
* f3ea3c98de4f48d5b56c376b3e4b2e82
|
||||
(接口限制每天最多访问1000次如需稳定请自己申请(免费))
|
||||
|
||||
|
||||
|
||||
# 关于量产版本!!!
|
||||
### 电路设计及pcb 请访问立创eda:https://oshwhub.com/hbk444/qi-xiang-zhan01
|
||||
### pcb板兼容1.3寸oled屏
|
||||
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
|
||||
## 说明
|
||||
源码需要配合WiFi_link_tool配网库进行开发
|
||||
可直接访问设备的ip或http://OLED气象站/ 进行访问
|
||||
所需要的库:
|
||||
* u8g2
|
||||
* ArduinoJson
|
||||
* time(以提供)
|
||||
天气API来自和风天气:console.heweather.com
|
||||
提供的固件是针对esp_01s的,其他开发板请下载源码进行编译!
|
||||
|
||||
# pc性能显示
|
||||
需要配合aida64,并且开启内存共享
|
||||

|
||||

|
||||
|
||||
注 上位机部分代码来自他人项目,所以就不开源了。其中使用了该项目的内存读取方法及窗体事件等 将原有的串口通信删除并添加了网络请求功能 项目地址:https://gitee.com/optimouskiller/AIDA64InfoReader
|
||||
|
||||
|
||||
# 关于b站up主专用固件(v3b)
|
||||
效果
|
||||

|
||||
后台
|
||||

|
||||
获取uid 电脑个人主页后数字,手机版在个人资料中
|
||||

|
||||
|
||||
# 如果不想折腾直接使用编译好的固件请往下看
|
||||
### esp01s连线图:
|
||||

|
||||
### 烧录注意事项
|
||||
esp01s与ttl链接方法:
|
||||
01s ttl
|
||||
xt----rx
|
||||
rx----tx
|
||||
vcc---3.3
|
||||
ch----3.3
|
||||
io0---gnd
|
||||
gnd---gnd
|
||||
|
||||
### 烧录配置
|
||||

|
||||
### 烧录流程
|
||||
1.擦除2.烧录
|
||||

|
||||
BIN
esp01s电路.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
图片资源/100_结果.bmp
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
图片资源/101_结果.bmp
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
图片资源/102_结果.bmp
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
图片资源/103_结果.bmp
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
图片资源/104_结果.bmp
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
图片资源/201_结果.bmp
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
图片资源/205_结果.bmp
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
图片资源/208_结果.bmp
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
图片资源/301_结果.bmp
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
图片资源/302_结果.bmp
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
图片资源/304_结果.bmp
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
图片资源/305_结果.bmp
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
图片资源/306_结果.bmp
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
图片资源/307_结果.bmp
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
图片资源/310_结果.bmp
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
图片资源/399_结果.bmp
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
图片资源/400_结果.bmp
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
图片资源/401_结果.bmp
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
图片资源/403_结果.bmp
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
图片资源/404_结果.bmp
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
图片资源/407_结果.bmp
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
图片资源/499_结果.bmp
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
图片资源/500_结果.bmp
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
图片资源/503_结果.bmp
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
图片资源/509_结果.bmp
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
图片资源/999_结果.bmp
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
26
图片资源/jg.txt
Normal file
@ -0,0 +1,26 @@
|
||||
const unsigned char col_100[] U8X8_PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x04,0x18,0x20,0x00,0x00,0x0e,0x00,0x70,0x00,0x00,0x1c,0x00,0x38,0x00,0x00,0x18,0x3c,0x18,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xc0,0xe7,0x03,0x00,0x00,0xe0,0x81,0x03,0x00,0x00,0xe0,0x00,0x07,0x00,0x00,0x70,0x00,0x06,0x00,0x00,0x30,0x00,0x0e,0x00,0xe0,0x31,0x00,0x8c,0x03,0xe0,0x31,0x00,0xcc,0x07,0x00,0x30,0x00,0x0c,0x00,0x00,0x70,0x00,0x0e,0x00,0x00,0x70,0x00,0x06,0x00,0x00,0xe0,0x00,0x07,0x00,0x00,0xc0,0xc3,0x03,0x00,0x00,0x80,0xff,0x01,0x00,0x00,0x08,0xff,0x10,0x00,0x00,0x1c,0x00,0x38,0x00,0x00,0x0e,0x00,0x70,0x00,0x00,0x06,0x00,0x60,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
const unsigned char col_101[] U8X8_PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,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,0x00,0x00,0x00,0x00,0xf0,0x07,0x00,0x00,0x00,0x38,0x1c,0x00,0x00,0x00,0x0f,0x78,0x00,0x00,0xc0,0x07,0xf0,0x01,0x00,0x60,0x04,0x00,0x03,0x00,0x60,0xff,0x00,0x02,0x00,0xe0,0xc3,0x03,0x02,0x00,0xf0,0x00,0x07,0x06,0x00,0x70,0x00,0x0e,0x02,0x00,0x3f,0x00,0xfc,0x03,0xc0,0x01,0x00,0xc0,0x03,0xc0,0x00,0x00,0x00,0x03,0x60,0x00,0x00,0x00,0x02,0x60,0x00,0x00,0x00,0x02,0x20,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x02,0x40,0x00,0x00,0x00,0x03,0xc0,0x00,0x00,0x80,0x01,0x80,0x73,0x00,0xe6,0x01,0x00,0xff,0x80,0x7f,0x00,0x00,0x80,0xff,0x01,0x00,0x00,0x00,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
const unsigned char col_102[] U8X8_PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xc0,0xff,0x01,0x00,0x00,0xe0,0x81,0x03,0x00,0x00,0x70,0x00,0x0f,0x00,0x00,0x3f,0x00,0xfe,0x00,0x80,0x3f,0x00,0xfc,0x01,0xc0,0x01,0x00,0x80,0x03,0xe0,0x00,0x00,0x00,0x03,0x60,0x00,0x00,0x00,0x07,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x07,0xc0,0x00,0x00,0x80,0x03,0xc0,0x63,0x00,0xc6,0x01,0x80,0xff,0x00,0xff,0x00,0x00,0xfe,0xe3,0x3f,0x00,0x00,0x80,0xff,0x01,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
const unsigned char col_103[] U8X8_PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x03,0x80,0x03,0x00,0x00,0x07,0x80,0x03,0x00,0x00,0xc6,0x8f,0x01,0x00,0x00,0xf0,0x3f,0x00,0x00,0x00,0x78,0x78,0x00,0x00,0x00,0x38,0x70,0x00,0x00,0x00,0x1c,0x60,0x00,0x00,0xe0,0x1c,0xfe,0x1c,0x00,0xf0,0x8d,0xff,0x1e,0x00,0xe0,0xdc,0xff,0x1f,0x00,0x00,0xfc,0x81,0x07,0x00,0x00,0x7e,0x00,0x7f,0x00,0x80,0x3f,0x00,0xfe,0x00,0xc0,0x13,0x00,0xe4,0x03,0xe0,0x00,0x00,0x80,0x03,0xe0,0x00,0x00,0x00,0x07,0x60,0x00,0x00,0x00,0x07,0x70,0x00,0x00,0x00,0x06,0x70,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x07,0xe0,0x00,0x00,0x00,0x03,0xe0,0x01,0x00,0x82,0x03,0xc0,0x7f,0x00,0xff,0x01,0x00,0xff,0x81,0xff,0x00,0x00,0xdc,0xff,0x39,0x00,0x00,0x80,0xff,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
const unsigned char col_104[] U8X8_PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x0e,0x00,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x00,0x1c,0x10,0x06,0x00,0x00,0x10,0xfe,0x3f,0x00,0x00,0x80,0xff,0x7f,0x00,0x00,0xc0,0xff,0xff,0x00,0x00,0xc0,0xf9,0xff,0x01,0x00,0xe0,0xfc,0xff,0x03,0x00,0x60,0xfc,0xff,0x03,0x00,0x70,0xfe,0xff,0x03,0xe0,0x71,0xfe,0xff,0x07,0xe0,0x73,0xfe,0xff,0x03,0x00,0x70,0xfe,0xff,0x07,0x00,0x70,0xfe,0xff,0x03,0x00,0x60,0xfc,0xff,0x03,0x00,0xe0,0xfc,0xff,0x03,0x00,0xc0,0xf9,0xff,0x01,0x00,0x80,0xff,0xff,0x00,0x00,0x00,0xff,0x7f,0x00,0x00,0x18,0xfc,0x1f,0x00,0x00,0x1c,0x00,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x00,0x0e,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
const unsigned char col_201[] U8X8_PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,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,0x00,0x00,0x00,0x00,0xe0,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0xff,0x01,0x00,0x00,0x80,0xff,0x01,0x00,0x00,0x80,0xc1,0x03,0x00,0x00,0xc0,0xc7,0x07,0x00,0x00,0xc0,0xdc,0x0c,0x00,0x00,0xc0,0xf8,0x0f,0x00,0x00,0xc0,0xc0,0x0f,0x00,0x00,0xc0,0xc0,0x06,0x00,0x00,0xc0,0xc0,0x06,0x00,0x00,0xe0,0xc1,0x03,0x00,0x00,0x60,0xcf,0x01,0x00,0x00,0x20,0xfe,0x01,0x00,0x00,0x60,0xe0,0x00,0x00,0x00,0xf0,0xc0,0x00,0x00,0x00,0xb0,0xe3,0x00,0x00,0x00,0x30,0xff,0x00,0x00,0x00,0x30,0xf0,0x00,0x00,0x00,0x30,0xf0,0x00,0x00,0x00,0x70,0xd8,0x00,0x00,0x00,0xe0,0xcf,0x00,0x00,0x00,0x00,0xcf,0x00,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x00,0xf0,0x03,0x00,0x00,0x00,0xf0,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
const unsigned char col_205[] U8X8_PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0xf0,0x61,0x00,0x00,0xe0,0xdf,0x63,0x00,0x00,0xff,0x83,0x66,0x00,0x80,0x13,0xc3,0x66,0x00,0x80,0x10,0x41,0x6c,0x00,0xc0,0x10,0x41,0x7c,0x00,0x80,0x18,0x41,0x74,0x00,0xc0,0x18,0x41,0x7c,0x00,0x80,0x10,0x41,0x6c,0x00,0x80,0x11,0xc3,0x66,0x00,0x00,0x7f,0x83,0x66,0x00,0x00,0xe0,0x9f,0x63,0x00,0x00,0x00,0xfc,0x63,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0xfc,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};
|
||||
const unsigned char col_208[] U8X8_PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0x03,0xe0,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0x03,0x00,0xfe,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0x1f,0x00,0xc0,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0x03,0x00,0xf8,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x3f,0x00,0x00,0x00,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x03,0x00,0x00,0x00,0xfe,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
const unsigned char col_301[] U8X8_PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0x03,0x01,0x00,0x00,0x03,0x80,0x03,0x00,0x00,0x07,0xc0,0x01,0x00,0x00,0xe6,0x8f,0x00,0x00,0x00,0xf0,0x3f,0x00,0x00,0x00,0x78,0x38,0x00,0x00,0x00,0x38,0x70,0x00,0x00,0x00,0x1c,0x60,0x00,0x00,0xe0,0x0c,0xfe,0x1c,0x00,0xf0,0x8c,0xff,0x1e,0x00,0x00,0xec,0xf7,0x03,0x00,0x00,0xfc,0x80,0x07,0x00,0x00,0x7e,0x00,0x7f,0x00,0x80,0x3f,0x00,0xfe,0x00,0xc0,0x13,0x00,0xe4,0x01,0xe0,0x00,0x00,0x80,0x03,0x60,0x00,0x00,0x00,0x07,0x70,0x00,0x00,0x00,0x07,0x70,0x00,0x00,0x00,0x07,0x70,0x00,0x00,0x00,0x07,0x60,0x00,0x00,0x00,0x07,0xe0,0x00,0x08,0x80,0x03,0xc0,0x21,0x18,0xc2,0x03,0xc0,0x7f,0x1c,0xff,0x01,0x00,0xff,0xbc,0xff,0x00,0x00,0xcc,0xbc,0x19,0x00,0x00,0x04,0x3c,0x20,0x00,0x00,0x0e,0x08,0x30,0x00,0x00,0x0e,0xc1,0x78,0x00,0x00,0x1e,0xc3,0x78,0x00,0x00,0x9e,0xe7,0x79,0x00,0x00,0x9e,0xe7,0x79,0x00,0x00,0x80,0xe7,0x01,0x00,0x00,0x80,0xe7,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
const unsigned char col_302[] U8X8_PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x00,0x00,0x00,0x80,0xff,0x01,0x00,0x00,0xe0,0xff,0x03,0x00,0x00,0xe0,0xc3,0x07,0x00,0x00,0xfe,0x00,0x7f,0x00,0x80,0x7f,0x00,0xfe,0x01,0xc0,0x3f,0x00,0xfc,0x03,0xe0,0x01,0x00,0xc0,0x07,0xe0,0x00,0x00,0x00,0x07,0xf0,0x00,0x00,0x00,0x07,0x70,0x00,0x00,0x00,0x0f,0x70,0x00,0x00,0x00,0x0f,0xf0,0x00,0x00,0x00,0x07,0xe0,0x00,0x00,0x00,0x07,0xe0,0x61,0x00,0x82,0x07,0xc0,0x7f,0x20,0xff,0x03,0x80,0xff,0xb1,0xff,0x01,0x00,0xff,0xbb,0x7f,0x00,0x00,0x80,0xdd,0x01,0x00,0x00,0x30,0x5e,0x03,0x00,0x00,0x70,0x1f,0x03,0x00,0x00,0x78,0x9f,0x07,0x00,0x00,0x78,0xbe,0x07,0x00,0x00,0xf8,0xfe,0x07,0x00,0x00,0x78,0x9e,0x07,0x00,0x00,0x30,0x0e,0x03,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
const unsigned char col_304[] U8X8_PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x80,0xff,0x00,0x00,0x00,0xc0,0xff,0x03,0x00,0x00,0xe0,0x81,0x07,0x00,0x00,0x7e,0x00,0x7f,0x00,0x80,0x3f,0x00,0xfe,0x01,0xc0,0x37,0x00,0xec,0x03,0xe0,0x01,0x00,0x80,0x03,0xe0,0x00,0x00,0x00,0x07,0x60,0x00,0x00,0x00,0x07,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x07,0xe0,0x00,0x00,0x00,0x07,0xe0,0x01,0x00,0x80,0x03,0xc0,0x7f,0x00,0xff,0x03,0x80,0xff,0x81,0xff,0x00,0x00,0xfe,0xff,0x7f,0x00,0x00,0x80,0xff,0x00,0x00,0x00,0x0e,0x3e,0x70,0x00,0x00,0x0f,0x00,0x78,0x00,0x00,0x1f,0x1c,0x78,0x00,0x00,0x0e,0x3c,0x78,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x07,0x00,0x00,0xf0,0x81,0x0f,0x00,0x00,0xf0,0x80,0x0f,0x00,0x00,0xe0,0x00,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};
|
||||
const unsigned char col_305[] U8X8_PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xc0,0xff,0x03,0x00,0x00,0xe0,0x81,0x07,0x00,0x00,0x70,0x00,0x0f,0x00,0x00,0x3f,0x00,0xfe,0x00,0x80,0x3f,0x00,0xfc,0x01,0xc0,0x01,0x00,0x80,0x03,0xe0,0x00,0x00,0x00,0x03,0x60,0x00,0x00,0x00,0x07,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x06,0xe0,0x00,0x00,0x00,0x07,0xe0,0x00,0x00,0x80,0x03,0xc0,0x63,0x00,0xc6,0x03,0x80,0xff,0x00,0xff,0x01,0x00,0xfe,0xfb,0x7f,0x00,0x00,0x80,0xff,0x01,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
const unsigned char col_306[] U8X8_PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xc0,0xff,0x03,0x00,0x00,0xe0,0x81,0x07,0x00,0x00,0x74,0x00,0x2f,0x00,0x00,0x3f,0x00,0xfe,0x00,0xc0,0x3f,0x00,0xfc,0x01,0xc0,0x01,0x00,0x80,0x03,0xe0,0x00,0x00,0x00,0x07,0x60,0x00,0x00,0x00,0x07,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x06,0xe0,0x00,0x00,0x00,0x07,0xc0,0x01,0x00,0x80,0x03,0xc0,0x73,0x00,0xe6,0x01,0x80,0xff,0x80,0xff,0x00,0x00,0xfe,0xff,0x3b,0x00,0x00,0x80,0xff,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x10,0x00,0x0c,0x00,0x00,0x38,0x00,0x0c,0x00,0x00,0x78,0x00,0x1e,0x00,0x00,0x7c,0x00,0x1e,0x00,0x00,0x38,0x18,0x1e,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
const unsigned char col_307[] U8X8_PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x80,0xff,0x00,0x00,0x00,0xc0,0xff,0x03,0x00,0x00,0xe0,0x81,0x07,0x00,0x00,0x7c,0x00,0x3f,0x00,0x80,0x3f,0x00,0xfe,0x00,0xc0,0x1f,0x00,0xfc,0x01,0xc0,0x01,0x00,0x80,0x03,0xe0,0x00,0x00,0x00,0x03,0x60,0x00,0x00,0x00,0x07,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x07,0xe0,0x00,0x00,0x00,0x07,0xe0,0x01,0x00,0x80,0x03,0xc0,0x77,0x00,0xe6,0x01,0x80,0xff,0x81,0xff,0x00,0x00,0xfe,0xff,0x3f,0x00,0x00,0x80,0xff,0x01,0x00,0x00,0x01,0x3c,0xc2,0x00,0x80,0x63,0x00,0xc3,0x01,0x80,0xe3,0x00,0xe7,0x01,0xc0,0xf3,0x00,0xe7,0x01,0x80,0xf3,0x80,0xef,0x01,0x00,0xf0,0x18,0x07,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
const unsigned char col_310[] U8X8_PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xc0,0xff,0x01,0x00,0x00,0xe0,0x81,0x07,0x00,0x00,0x70,0x00,0x2f,0x00,0x00,0x3f,0x00,0xfe,0x00,0xc0,0x17,0x00,0xfc,0x01,0xc0,0x01,0x00,0x80,0x03,0xe0,0x00,0x00,0x00,0x03,0x60,0x00,0x00,0x00,0x07,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x07,0xe0,0x00,0x00,0x00,0x03,0xc0,0x01,0x00,0x80,0x03,0xc0,0x63,0x00,0xe6,0x01,0x80,0xff,0x80,0xff,0x00,0x00,0xcc,0xf7,0x1b,0x00,0x00,0x80,0xff,0x00,0x00,0x00,0x01,0x84,0xc0,0x00,0x80,0x83,0x81,0xc0,0x01,0x80,0x83,0xc1,0xe1,0x01,0xc0,0xc3,0xc3,0xe1,0x01,0x80,0xc3,0xc3,0xeb,0x01,0x00,0xd8,0xcb,0x0d,0x00,0x00,0x38,0x1c,0x1c,0x00,0x00,0x3c,0x1c,0x1e,0x00,0x00,0x3c,0x3c,0x1e,0x00,0x00,0x18,0x1c,0x1c,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
const unsigned char col_399[] U8X8_PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x7e,0x00,0x00,0x00,0x00,0x7e,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x7e,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x10,0x00,0x00,0x1c,0x00,0x38,0x00,0x00,0x1e,0x00,0x78,0x00,0x00,0x3e,0x00,0x7c,0x00,0x00,0x7f,0x00,0xfe,0x00,0x00,0x7f,0x00,0xfe,0x00,0x00,0x7f,0x00,0xfe,0x00,0x00,0x7f,0x00,0xfe,0x00,0x00,0x7f,0x00,0xfe,0x00,0x00,0x3f,0x00,0xfc,0x00,0x00,0x1e,0x00,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
const unsigned char col_400[] U8X8_PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x80,0xff,0x00,0x00,0x00,0xc0,0xe3,0x03,0x00,0x00,0xe0,0x00,0x07,0x00,0x00,0x7e,0x00,0x3e,0x00,0x80,0x3f,0x00,0xfc,0x00,0xc0,0x01,0x00,0xc0,0x01,0xc0,0x00,0x00,0x00,0x03,0x60,0x00,0x00,0x00,0x03,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x03,0x60,0x00,0x00,0x00,0x03,0xc0,0x00,0x00,0x80,0x03,0x80,0x77,0x00,0xef,0x01,0x00,0xff,0x80,0x7f,0x00,0x00,0xc0,0xf7,0x01,0x00,0x00,0x00,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
const unsigned char col_401[] U8X8_PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xc0,0xc3,0x01,0x00,0x00,0x60,0x00,0x03,0x00,0x00,0x38,0x00,0x06,0x00,0x80,0x3f,0x00,0xfc,0x00,0xc0,0x01,0x00,0xc0,0x01,0xc0,0x00,0x00,0x00,0x03,0x60,0x00,0x00,0x00,0x03,0x20,0x00,0x00,0x00,0x02,0x20,0x00,0x00,0x00,0x02,0x20,0x00,0x00,0x00,0x02,0x60,0x00,0x00,0x00,0x02,0x60,0x00,0x00,0x00,0x03,0xc0,0x00,0x00,0x80,0x01,0x80,0x73,0x00,0xe6,0x00,0x00,0xff,0x80,0x7f,0x00,0x00,0xc0,0xff,0x01,0x00,0x00,0x00,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x00,0x0e,0x00,0x00,0x38,0x00,0x0e,0x00,0x00,0x7c,0x00,0x1f,0x00,0x00,0x38,0x00,0x0c,0x00,0x00,0x28,0x14,0x00,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
const unsigned char col_403[] U8X8_PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x00,0x00,0x00,0x80,0xff,0x01,0x00,0x00,0xc0,0x81,0x03,0x00,0x00,0x60,0x00,0x06,0x00,0x00,0x3e,0x00,0x7c,0x00,0x80,0x03,0x00,0xc4,0x01,0xc0,0x01,0x00,0x80,0x03,0xc0,0x00,0x00,0x00,0x03,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x06,0x40,0x00,0x00,0x00,0x02,0xc0,0x00,0x00,0x00,0x03,0x80,0x01,0x00,0x82,0x01,0x00,0x7f,0x00,0xff,0x00,0x00,0xdc,0x81,0x2b,0x00,0x00,0x00,0xff,0x00,0x00,0x80,0x02,0x18,0xa0,0x00,0x80,0x03,0x00,0x60,0x00,0xc0,0x8f,0x81,0xf9,0x03,0x80,0x83,0xc3,0xe1,0x00,0x80,0x82,0x81,0xa1,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x24,0x38,0x00,0x00,0x38,0x18,0x38,0x00,0x00,0x00,0x7e,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
const unsigned char col_404[] U8X8_PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x00,0x00,0x00,0x80,0xe3,0x01,0x00,0x00,0xc0,0x80,0x03,0x00,0x00,0x60,0x00,0x06,0x00,0x00,0x3f,0x00,0xfc,0x00,0x80,0x03,0x00,0xc0,0x01,0xc0,0x00,0x00,0x80,0x03,0x40,0x00,0x00,0x00,0x03,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x02,0x40,0x00,0x00,0x00,0x02,0xc0,0x00,0x00,0x00,0x03,0x80,0x63,0x00,0xc2,0x01,0x00,0xff,0x00,0xff,0x00,0x00,0xc8,0xc3,0x11,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x80,0x00,0x00,0x03,0x00,0xc0,0x00,0x80,0x03,0x00,0xc0,0x01,0x80,0x03,0x00,0xc0,0x01,0x80,0x63,0x00,0xc2,0x01,0x00,0xe0,0x00,0x07,0x00,0x00,0x60,0x18,0x02,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
const unsigned char col_407[] U8X8_PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x80,0x03,0x00,0x00,0x06,0x80,0x01,0x00,0x00,0xc0,0x0f,0x00,0x00,0x00,0xf0,0x3c,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x18,0x60,0x00,0x00,0x00,0x08,0x40,0x00,0x00,0xe0,0x08,0x78,0x1c,0x00,0xe0,0x88,0xff,0x1e,0x00,0x00,0xc8,0x81,0x03,0x00,0x00,0x78,0x00,0x07,0x00,0x00,0x3e,0x00,0x7e,0x00,0x80,0x3f,0x00,0xfc,0x01,0xc0,0x01,0x00,0x80,0x03,0xc0,0x00,0x00,0x00,0x03,0x60,0x00,0x00,0x00,0x02,0x60,0x00,0x00,0x00,0x06,0x20,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x02,0xc0,0x00,0x00,0x00,0x03,0xc0,0x01,0x00,0x80,0x01,0x80,0x7f,0x24,0xfe,0x00,0x00,0xfe,0x3c,0x3f,0x00,0x00,0x00,0x1c,0x01,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x00,0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
const unsigned char col_499[] U8X8_PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x80,0xff,0x01,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x66,0x00,0x00,0x00,0x00,0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4c,0x00,0x32,0x00,0x00,0x4c,0x00,0x32,0x00,0x00,0x78,0x00,0x1e,0x00,0x00,0x78,0x00,0x1e,0x00,0x00,0xff,0xc3,0xff,0x00,0x00,0x78,0x00,0x1e,0x00,0x00,0x78,0x00,0x1e,0x00,0x00,0xcc,0x00,0x33,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
const unsigned char col_500[] U8X8_PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xc0,0xc3,0x03,0x00,0x00,0xe0,0x00,0x07,0x00,0x00,0x70,0x00,0x06,0x00,0xe0,0xff,0x0f,0x0c,0x00,0x00,0x18,0x00,0x0c,0x00,0x00,0x18,0x00,0x08,0x00,0x00,0x18,0x00,0x18,0x00,0x80,0xff,0xff,0xff,0x03,0x00,0x18,0x00,0x18,0x00,0x00,0x18,0x00,0x08,0x00,0x00,0x38,0x00,0x0c,0x00,0xe0,0xff,0xff,0x3f,0x00,0x00,0xe0,0x00,0x07,0x00,0x00,0xe0,0x00,0x03,0x00,0x00,0x80,0xe7,0x01,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};
|
||||
const unsigned char col_503[] U8X8_PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x0c,0x10,0x38,0x00,0x00,0x0e,0x18,0xf0,0x00,0x00,0x00,0x00,0xf0,0x01,0x00,0x00,0x00,0xe0,0x03,0x00,0x80,0x03,0xe0,0x03,0xc0,0x80,0x03,0xe0,0x07,0xc0,0x00,0xc0,0xf0,0x07,0x00,0x00,0xc0,0xf0,0x03,0x00,0x30,0x00,0xf8,0x03,0x00,0x30,0x00,0xfe,0x01,0x00,0x30,0x80,0xff,0x00,0x00,0x00,0xf0,0xff,0x00,0xc0,0xff,0xff,0xf7,0x00,0x00,0xfe,0xff,0xf0,0x00,0x00,0x00,0x00,0xf8,0x00,0x00,0x30,0x18,0xfc,0x00,0x00,0x30,0x18,0x7e,0x00,0x00,0x00,0xc0,0x3f,0x00,0x00,0xf8,0xff,0x3f,0x00,0x00,0x80,0x7f,0x38,0x00,0x00,0x00,0x01,0x3c,0x00,0x00,0x80,0x01,0x1f,0x00,0x00,0x80,0xc1,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};
|
||||
const unsigned char col_509[] U8X8_PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,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,0x7f,0x00,0x00,0xfe,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0x7f,0x00,0x00,0xfe,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0x7f,0x00,0x00,0xfe,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0x7f,0x00,0x00,0xfe,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0x7f,0x00,0x00,0xfe,0xff,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};
|
||||
const unsigned char col_999[] U8X8_PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,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,0x00,0x00,0xc0,0xc1,0xc1,0xf0,0x00,0xc0,0xc1,0xe1,0xf0,0x00,0xc0,0xc3,0x61,0xf0,0x00,0xc0,0xc7,0x61,0xf8,0x01,0xc0,0xc7,0x71,0xf8,0x01,0xc0,0xcf,0x31,0xb8,0x03,0xc0,0xdf,0x31,0x9c,0x03,0xc0,0xfd,0x39,0x9c,0x03,0xc0,0xf9,0x19,0xfc,0x07,0xc0,0xf9,0x19,0xfe,0x07,0xc0,0xf1,0x1d,0xfe,0x07,0xc0,0xe1,0x0d,0x0e,0x0f,0xc0,0xe1,0x0d,0x07,0x0e,0x00,0x00,0x0e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
BIN
图片资源/wxwx.bmp
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
602
源码/WeatherStation/WeatherStation.ino
Normal file
@ -0,0 +1,602 @@
|
||||
|
||||
#include <Esp8266Gzip.h>
|
||||
|
||||
/*
|
||||
* 2023.7.10 zhb1190
|
||||
* 1、增加对gzip响应的处理
|
||||
* 2、修改气象站源码的稳定性
|
||||
*
|
||||
*
|
||||
*
|
||||
0.96 气象站 第五版 配套源码
|
||||
|
||||
需要配合wifi_link_tool配网工具 地址:https://github.com/bilibilifmk/wifi_link_tool
|
||||
所需库:
|
||||
u8g2
|
||||
ArduinoJson
|
||||
time(以提供)
|
||||
by:发明控
|
||||
*/
|
||||
//#define SERIAL_DEBUG
|
||||
#define FS_CONFIG
|
||||
//兼容1.1.x版本库
|
||||
#include <wifi_link_tool.h>
|
||||
#include <ArduinoJson.h>
|
||||
#include <Arduino.h>
|
||||
|
||||
#ifndef SERIAL_DEBUG
|
||||
#include <U8g2lib.h>
|
||||
#include "zlt.h"
|
||||
#endif
|
||||
|
||||
#include <WiFiClientSecure.h>
|
||||
|
||||
#include <Time.h>
|
||||
#include <TimeLib.h>
|
||||
#include <WiFiUdp.h>
|
||||
#include <WiFiClientSecure.h>
|
||||
|
||||
#include <WiFiClientSecureBearSSL.h>
|
||||
|
||||
#ifdef U8X8_HAVE_HW_SPI
|
||||
#include <SPI.h>
|
||||
#endif
|
||||
#ifdef U8X8_HAVE_HW_I2C
|
||||
#include <Wire.h>
|
||||
#endif
|
||||
|
||||
String keys = "xxxxx"; // 接口地址:https://console.qweather.com/app/index
|
||||
String dq = "xxxx"; //填入城市编号 获取编号 https://where.qweather.com/index.html
|
||||
|
||||
static const uint8_t D1 = 1;
|
||||
static const uint8_t D2 = 3;
|
||||
static const uint8_t D3 = 0;
|
||||
static const uint8_t D4 = 2;
|
||||
|
||||
#define sck D1 /* 屏幕 */
|
||||
#define sda D2
|
||||
|
||||
const int CONFIG_HTTPPORT = 80;
|
||||
const int CONFIG_HTTPSPORT = 443;
|
||||
|
||||
//const uint8_t fingerprint[20] = { 0xB8, 0x93, 0x1E, 0xBD, 0xCB, 0xCD, 0xCE, 0xE5, 0xC5, 0x9F, 0x08, 0x43, 0xA8, 0x6C, 0x8C, 0xD0, 0xF7, 0xCB, 0x1E, 0x42 };
|
||||
|
||||
#ifndef SERIAL_DEBUG
|
||||
U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2( U8G2_R0, /* clock=*/ sck, /* data=*/ sda, /* reset=*/ U8X8_PIN_NONE );
|
||||
#endif
|
||||
int col = 999;
|
||||
String diqu = "";
|
||||
int tq = 0;
|
||||
String pm2 = "";
|
||||
String wendu = "";
|
||||
String tim = "00:00";
|
||||
String dat = "2019/01/01";
|
||||
unsigned long previousMillis = 0;
|
||||
const long interval = 30000; /* 30秒更新屏幕 */
|
||||
unsigned long previousMillis2 = 0;
|
||||
const long interval2 =1800000; /* 半小时更新天气 */
|
||||
int one = 0;
|
||||
int pcboot=0; //pc请求识别
|
||||
IPAddress timeServer( 120, 25, 115, 20 ); /* 阿里云ntp服务器 如果失效可以使用 120.25.115.19 120.25.115.20 */
|
||||
#define STD_TIMEZONE_OFFSET +8 /* 设置中国 */
|
||||
const int timeZone = 8; /* 修改北京时区 */
|
||||
WiFiUDP Udp;
|
||||
|
||||
unsigned int localPort = 8266; /* 修改udp 有些路由器端口冲突时修改 */
|
||||
int servoLift = 1500;
|
||||
|
||||
void setup()
|
||||
{
|
||||
WiFiServer HTTPserver( CONFIG_HTTPPORT );
|
||||
WiFiServerSecure HTTPSserver( CONFIG_HTTPSPORT );
|
||||
|
||||
#ifdef SERIAL_DEBUG
|
||||
Serial.begin( 115200 );
|
||||
#endif
|
||||
/*
|
||||
* 开启串口
|
||||
* ///////////////////////////////////////////////////////基础设置//////////////////////////////////////////////////////////
|
||||
*/
|
||||
|
||||
rstb = D3;
|
||||
/* 重置io */
|
||||
stateled = D4;
|
||||
/* 指示灯io */
|
||||
Hostname = "oled气象站";
|
||||
/* 设备名称 允许中文名称 不建议太长 */
|
||||
wxscan = true;
|
||||
/* 是否被小程序发现设备 开启意味该设备具有后台 true开启 false关闭 */
|
||||
#ifndef SERIAL_DEBUG
|
||||
u8g2.begin();
|
||||
u8g2.enableUTF8Print();
|
||||
u8g2.setFont( u8g2_font_unifont_t_chinese2 );
|
||||
u8g2.setFontDirection( 0 );
|
||||
u8g2.clearBuffer();
|
||||
u8g2.setCursor( 0, 15 );
|
||||
u8g2.print( "开机" );
|
||||
u8g2.setCursor( 0, 30 );
|
||||
u8g2.print( "WiFi to Link" );
|
||||
u8g2.sendBuffer();
|
||||
#endif
|
||||
webServer.on("/pc", pc);//pc请求
|
||||
load();
|
||||
/* 初始化WiFi link tool */
|
||||
#ifdef SERIAL_DEBUG
|
||||
Serial.println( "设置 UDP" );
|
||||
#endif
|
||||
Udp.begin( localPort );
|
||||
#ifdef SERIAL_DEBUG
|
||||
Serial.print( "Local port: " );
|
||||
Serial.println( Udp.localPort() );
|
||||
Serial.println( "正在等待同步" );
|
||||
#endif
|
||||
if ( link() )
|
||||
{
|
||||
#ifndef SERIAL_DEBUG
|
||||
u8g2.setFont( u8g2_font_unifont_t_chinese2 );
|
||||
u8g2.setFontDirection( 0 );
|
||||
u8g2.clearBuffer();
|
||||
u8g2.setCursor( 0, 15 );
|
||||
u8g2.print( "开机" );
|
||||
u8g2.setCursor( 0, 30 );
|
||||
u8g2.print( "WiFi to Link" );
|
||||
u8g2.setCursor( 0, 45 );
|
||||
u8g2.print( "OK" );
|
||||
u8g2.setCursor( 0, 60 );
|
||||
u8g2.print( WiFi.localIP() );
|
||||
u8g2.sendBuffer();
|
||||
#endif
|
||||
sjfx();
|
||||
delay( 1000 );
|
||||
#ifndef SERIAL_DEBUG
|
||||
u8g2.sendBuffer();
|
||||
u8g2.clearBuffer();
|
||||
u8g2.drawXBMP(0,0,128,64,logo);
|
||||
u8g2.sendBuffer();
|
||||
#endif
|
||||
delay(1000);
|
||||
|
||||
setSyncProvider( getNtpTime );
|
||||
shuaxin();
|
||||
}else{
|
||||
#ifndef SERIAL_DEBUG
|
||||
u8g2.setFont( u8g2_font_unifont_t_chinese2 );
|
||||
u8g2.setFontDirection( 0 );
|
||||
u8g2.clearBuffer();
|
||||
u8g2.setCursor( 45, 15 );
|
||||
u8g2.print( "配网" );
|
||||
u8g2.setCursor( 0, 30 );
|
||||
u8g2.print( "AP TO Link:" );
|
||||
u8g2.setCursor( 0, 45 );
|
||||
u8g2.print( "wifi_link_tool" );
|
||||
u8g2.setCursor( 0, 60 );
|
||||
u8g2.print( "IP:6.6.6.6" );
|
||||
u8g2.sendBuffer();
|
||||
#endif
|
||||
delay( 5000 );
|
||||
#ifndef SERIAL_DEBUG
|
||||
u8g2.clearBuffer();
|
||||
u8g2.drawXBMP( 0, 0, 128, 64, wx );
|
||||
u8g2.sendBuffer();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void loop()
|
||||
{
|
||||
pant(); /* WiFi link tool 服务维持函数 请勿修改位置 */
|
||||
if ( link() )
|
||||
{
|
||||
unsigned long currentMillis = millis();
|
||||
if ( currentMillis - previousMillis >= interval )
|
||||
{
|
||||
previousMillis = currentMillis;
|
||||
shuaxin();
|
||||
//xx();
|
||||
}
|
||||
unsigned long currentMillis2 = millis();
|
||||
if ( currentMillis2 - previousMillis2 >= interval2 )
|
||||
{
|
||||
previousMillis2 = currentMillis2;
|
||||
one = 0;
|
||||
sjfx();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void sjfx()
|
||||
{
|
||||
xx();
|
||||
delay( 1000 );
|
||||
pm();
|
||||
delay( 1000 );
|
||||
col = tq;
|
||||
#ifdef SERIAL_DEBUG
|
||||
Serial.println( "当前地区: " + diqu );
|
||||
Serial.println( "天气代码: " + tq);
|
||||
Serial.println( "体感温度: " + wendu );
|
||||
Serial.println( "PM2.5: " + pm2 );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void shuaxin() {
|
||||
if(pcboot==0) {
|
||||
{
|
||||
String zov = "";
|
||||
if (hour() < 10) {
|
||||
zov = "0";
|
||||
}
|
||||
|
||||
if (minute() < 10) {
|
||||
tim = zov + String( hour() ) + ":0" + String( minute() );
|
||||
}else{
|
||||
tim = zov + String( hour() ) + ":" + String( minute() );
|
||||
}
|
||||
|
||||
dat = String( year() ) + "/" + String( month() ) + "/" + String( day() );
|
||||
#ifdef SERIAL_DEBUG
|
||||
Serial.print( tim ); /* 输出当前网络分钟 */
|
||||
Serial.print(" ");
|
||||
Serial.print( dat ); /* 输出当前日期 */
|
||||
Serial.println();
|
||||
#endif
|
||||
#ifndef SERIAL_DEBUG
|
||||
u8g2.clearBuffer();
|
||||
#endif
|
||||
}
|
||||
/* */
|
||||
tubiao();
|
||||
#ifndef SERIAL_DEBUG
|
||||
{
|
||||
u8g2.setFont(u8g2_font_ncenB18_tf);
|
||||
u8g2.setFontDirection(0);
|
||||
u8g2.setCursor(65,53);
|
||||
u8g2.print(wendu); //温度
|
||||
u8g2.setFont(u8g2_font_6x10_tf);
|
||||
u8g2.setFontDirection(0);
|
||||
u8g2.setCursor(60,64);
|
||||
u8g2.print(dat); //日期
|
||||
u8g2.drawXBMP(100,32,25,25,col_ssd);
|
||||
u8g2.setFont(u8g2_font_ncenR12_tf);
|
||||
u8g2.setFontDirection(0);
|
||||
u8g2.setCursor(0,48);
|
||||
u8g2.print("pm2.5");
|
||||
u8g2.setCursor(10,62);
|
||||
u8g2.print(pm2); //pm2.5 浓度
|
||||
u8g2.setFont(u8g2_font_fub25_tf);
|
||||
u8g2.setFontDirection(0);
|
||||
u8g2.setCursor(40,32);
|
||||
u8g2.print(tim);
|
||||
u8g2.sendBuffer();
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
pcboot=0;
|
||||
}
|
||||
}
|
||||
|
||||
void tubiao( ){
|
||||
#ifndef SERIAL_DEBUG
|
||||
const unsigned char* icon = col_999;
|
||||
if (col==100||col==150){ //晴
|
||||
icon = col_100;
|
||||
}
|
||||
|
||||
else if (col==102||col==101){
|
||||
icon = col_102;
|
||||
}else if (col==103||col==153){
|
||||
icon = col_103;//晴间多云
|
||||
}else if (col==104||col==154){
|
||||
icon = col_104;//阴
|
||||
}
|
||||
|
||||
else if (col>=300&&col<=301){
|
||||
icon = col_301;//阵雨
|
||||
}else if (col>=302&&col<=303){
|
||||
icon = col_302;//雷阵雨
|
||||
}else if (col==304){
|
||||
icon = col_304;//冰雹
|
||||
}else if (col==399||col==314||col==305||col==306||col==307||col==315||col==350||col==351){
|
||||
icon = col_307;//雨
|
||||
}
|
||||
|
||||
else if ((col>=308&&col<=313)||(col>=316&&col<=318)){
|
||||
icon = col_310;//暴雨
|
||||
}else if ((col>=402&&col<=406)||col==409||col==410||col==400||col==401||col==408||col==499||col==456){
|
||||
icon = col_401;//雪
|
||||
}else if (col==407||col==457){
|
||||
icon = col_407;//阵雪
|
||||
}else if (col>=500&&col<=502){
|
||||
icon = col_500;//雾霾
|
||||
}else if (col>=503&&col<=508){
|
||||
icon = col_503;//沙尘暴
|
||||
}else if (col>=509&&col<=515){
|
||||
icon = col_509;;//不适宜生存
|
||||
}
|
||||
u8g2.drawXBMP(0,0,40,40,icon);
|
||||
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void pc() {
|
||||
#if 0
|
||||
pcboot=1;
|
||||
String clk=webServer.arg("clk");
|
||||
String cpu=webServer.arg("cpu");
|
||||
String ram=webServer.arg("ram");
|
||||
String cput=webServer.arg("cput");
|
||||
webServer.arg("cpuv");
|
||||
#ifndef SERIAL_DEBUG
|
||||
u8g2.clearBuffer();
|
||||
u8g2.drawXBMP(0,0,128,64,pctp);
|
||||
u8g2.setFont(u8g2_font_crox5hb_tf);
|
||||
u8g2.setFontDirection(0);
|
||||
u8g2.setCursor(33,25);
|
||||
u8g2.print(cpu); //cpu
|
||||
u8g2.setCursor(33,57);
|
||||
u8g2.print(cput); //cput
|
||||
u8g2.setCursor(95,57);
|
||||
u8g2.print(ram); //ram
|
||||
u8g2.setFont(u8g2_font_ncenR10_tf);
|
||||
u8g2.setFontDirection(0);
|
||||
u8g2.setCursor(96,16);
|
||||
u8g2.print(clk); //mhz
|
||||
u8g2.setCursor(94,30);
|
||||
u8g2.print("MHz");
|
||||
|
||||
u8g2.sendBuffer();
|
||||
#endif
|
||||
webServer.send(200, "text/plain", "ojbk");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* //////////////////////////////////////////////////天气数据 */
|
||||
void xx()
|
||||
{
|
||||
uint32_t outlen = 512;
|
||||
uint8_t* buff = (uint8_t*)malloc(outlen);
|
||||
if(!buff) {
|
||||
#ifdef SERIAL_DEBUG
|
||||
Serial.println("malloc memory failed");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
if(https_get_gzip("https://devapi.qweather.net/v7/weather/now?gzip=n&location="+dq+"&key="+keys,
|
||||
buff,
|
||||
outlen)) {
|
||||
#ifdef SERIAL_DEBUG
|
||||
Serial.printf("Get Data %s\n", buff);
|
||||
#endif
|
||||
} else {
|
||||
free(buff);
|
||||
return;
|
||||
}
|
||||
|
||||
DynamicJsonBuffer jsonBuffer(1024);
|
||||
JsonObject& res_json = jsonBuffer.parseObject(buff);
|
||||
String r1=res_json["basic"]["location"];//地区
|
||||
int r2=res_json["now"]["icon"];//天气
|
||||
String r3=res_json["now"]["feelsLike"];//体感温度
|
||||
jsonBuffer.clear();
|
||||
diqu = r1; /* 地区 */
|
||||
tq = r2; /* 天气 */
|
||||
wendu = r3.toInt(); /* 体感温度 */
|
||||
|
||||
free(buff);
|
||||
}
|
||||
|
||||
|
||||
void pm()
|
||||
{
|
||||
uint32_t outlen = 1024;
|
||||
uint8_t* buff = (uint8_t*)malloc(outlen);
|
||||
if(!buff) {
|
||||
#ifdef SERIAL_DEBUG
|
||||
Serial.println("malloc memory failed");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
if(https_get_gzip("https://devapi.qweather.net/v7/air/now?gzip=n&location="+dq+"&key="+keys,
|
||||
buff,
|
||||
outlen)) {
|
||||
#ifdef SERIAL_DEBUG
|
||||
Serial.printf("Get Data %s\n", buff);
|
||||
#endif
|
||||
} else {
|
||||
free(buff);
|
||||
return;
|
||||
}
|
||||
|
||||
DynamicJsonBuffer jsonBuffer(1024);
|
||||
JsonObject& res_json = jsonBuffer.parseObject(buff);
|
||||
String r1=res_json["now"]["pm2p5"];//pm25
|
||||
jsonBuffer.clear();
|
||||
if ( r1 != "" )
|
||||
{
|
||||
pm2 = r1; /* pm2.5 */
|
||||
}
|
||||
free(buff);
|
||||
}
|
||||
|
||||
/* ////////////////////////////////////////////////////////////////解包设置////////////////////////////////////////////////////////////////////////////////////////////////////////////// */
|
||||
void digitalClockDisplay()
|
||||
{
|
||||
/* */
|
||||
#ifdef SERIAL_DEBUG
|
||||
Serial.print( hour() );
|
||||
#endif
|
||||
printDigits( minute() );
|
||||
#ifdef SERIAL_DEBUG
|
||||
Serial.println();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void printDigits( int digits )
|
||||
{
|
||||
#ifdef SERIAL_DEBUG
|
||||
Serial.print( ":" );
|
||||
#endif
|
||||
if ( digits < 10 ) {
|
||||
#ifdef SERIAL_DEBUG
|
||||
Serial.print( '0' );
|
||||
#endif
|
||||
}
|
||||
#ifdef SERIAL_DEBUG
|
||||
Serial.print( digits );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
bool https_get_gzip(String url, uint8_t* outbuf, uint32_t& outlen)
|
||||
{
|
||||
uint8_t* buff = 0;
|
||||
int readed = 0;
|
||||
{
|
||||
std::unique_ptr<BearSSL::WiFiClientSecure>client(new BearSSL::WiFiClientSecure);
|
||||
client->setInsecure();
|
||||
HTTPClient https;
|
||||
#ifdef SERIAL_DEBUG
|
||||
Serial.println("HTTP begin");
|
||||
#endif
|
||||
if (https.begin(*client, url))
|
||||
{
|
||||
#ifdef SERIAL_DEBUG
|
||||
Serial.println("HTTP GET...");
|
||||
#endif
|
||||
int httpCode = https.GET();
|
||||
#ifdef SERIAL_DEBUG
|
||||
Serial.printf("HTTP Code %d\n", httpCode);
|
||||
#endif
|
||||
int len = 0;
|
||||
if (httpCode == HTTP_CODE_OK) {
|
||||
len = https.getSize();
|
||||
#ifdef SERIAL_DEBUG
|
||||
Serial.printf("HTTP body len %d\n", len);
|
||||
#endif
|
||||
} else {
|
||||
#ifdef SERIAL_DEBUG
|
||||
Serial.println("HTTP GET error");
|
||||
#endif
|
||||
https.end();
|
||||
return false;
|
||||
}
|
||||
buff = (uint8_t*)malloc(sizeof(uint8_t)*(len+1));
|
||||
memset(buff, 0, len+1);
|
||||
while (https.connected() && (len > 0 || len == -1)) {
|
||||
// read up to 128 byte
|
||||
int c = client->readBytes(buff+readed, std::min((size_t)len, (size_t)(len-1-readed)));
|
||||
#ifdef SERIAL_DEBUG
|
||||
Serial.printf("readBytes: %d\n", c);
|
||||
#endif
|
||||
if (!c) {
|
||||
#ifdef SERIAL_DEBUG
|
||||
Serial.println("read timeout");
|
||||
#endif
|
||||
readed = 0;
|
||||
break;
|
||||
}
|
||||
readed+=c;
|
||||
if (len > 0) { len -= c; }
|
||||
}
|
||||
#ifdef SERIAL_DEBUG
|
||||
Serial.printf("HTTP buff len %d\n", readed);
|
||||
#endif
|
||||
https.end();
|
||||
} else {
|
||||
#ifdef SERIAL_DEBUG
|
||||
Serial.printf("[HTTPS]请求链接失败\n");
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(outlen<=readed) {
|
||||
#ifdef SERIAL_DEBUG
|
||||
Serial.println("out buf is too small");
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
if(readed) {
|
||||
memset(outbuf, 0, outlen);
|
||||
|
||||
int result = 0;
|
||||
#ifdef SERIAL_DEBUG
|
||||
Serial.println(ESP.getFreeHeap());
|
||||
#endif
|
||||
|
||||
result=Esp8266Gzip::decompress_gzip(buff, readed, outbuf, outlen,outlen);
|
||||
if(result>0){
|
||||
//Serial.write(outbuf,outlen);
|
||||
} else {
|
||||
#ifdef SERIAL_DEBUG
|
||||
Serial.printf("gzip decode ret %d\n", result);
|
||||
#endif
|
||||
outlen = 0;
|
||||
return false;
|
||||
}
|
||||
free(buff);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
const int NTP_PACKET_SIZE = 48;
|
||||
byte packetBuffer[NTP_PACKET_SIZE];
|
||||
|
||||
time_t getNtpTime()
|
||||
{
|
||||
while ( Udp.parsePacket() > 0 )
|
||||
;
|
||||
#ifdef SERIAL_DEBUG
|
||||
Serial.println( "连接时间服务器" );
|
||||
#endif
|
||||
sendNTPpacket( timeServer );
|
||||
uint32_t beginWait = millis();
|
||||
while ( millis() - beginWait < 1500 )
|
||||
{
|
||||
int size = Udp.parsePacket();
|
||||
if ( size >= NTP_PACKET_SIZE )
|
||||
{
|
||||
Serial.println( "时间服务器应答" );
|
||||
Udp.read( packetBuffer, NTP_PACKET_SIZE );
|
||||
unsigned long secsSince1900;
|
||||
/* convert four bytes starting at location 40 to a long integer */
|
||||
secsSince1900 = (unsigned long) packetBuffer[40] << 24;
|
||||
secsSince1900 |= (unsigned long) packetBuffer[41] << 16;
|
||||
secsSince1900 |= (unsigned long) packetBuffer[42] << 8;
|
||||
secsSince1900 |= (unsigned long) packetBuffer[43];
|
||||
return(secsSince1900 - 2208988800UL + timeZone * SECS_PER_HOUR);
|
||||
}
|
||||
}
|
||||
#ifdef SERIAL_DEBUG
|
||||
Serial.println( "No NTP Response :-(" );
|
||||
#endif
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
void sendNTPpacket( IPAddress &address )
|
||||
{
|
||||
memset( packetBuffer, 0, NTP_PACKET_SIZE );
|
||||
|
||||
packetBuffer[0] = 0b11100011;
|
||||
packetBuffer[1] = 0;
|
||||
packetBuffer[3] = 0xEC;
|
||||
|
||||
packetBuffer[12] = 49;
|
||||
packetBuffer[13] = 0x4E;
|
||||
packetBuffer[14] = 49;
|
||||
packetBuffer[15] = 52;
|
||||
Udp.beginPacket( address, 123 );
|
||||
Udp.write( packetBuffer, NTP_PACKET_SIZE );
|
||||
Udp.endPacket();
|
||||
}
|
||||
47
源码/WeatherStation/data/config.html
Normal file
167
源码/WeatherStation/data/index.html
Normal file
@ -0,0 +1,167 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv='Content-type' content='text/html; charset=utf-8'>
|
||||
<title>气象站管理系统</title>
|
||||
|
||||
<style>
|
||||
|
||||
body{text-align:center}
|
||||
h1{
|
||||
color:#ff8eb3;
|
||||
text-align:center;
|
||||
font-size: 30px;
|
||||
|
||||
}
|
||||
h2{
|
||||
color:#ff8eb3;
|
||||
font-size: 40px;
|
||||
|
||||
|
||||
}
|
||||
p{
|
||||
color:#ff8eb3;
|
||||
|
||||
}
|
||||
a{
|
||||
color:#ff8eb3;
|
||||
|
||||
}
|
||||
h3{
|
||||
color:#ff8eb3;
|
||||
|
||||
}
|
||||
span{
|
||||
color:#ff8eb3;
|
||||
font-size: 75px;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
.af {
|
||||
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
|
||||
margin: 20px;
|
||||
text-align: center;
|
||||
font-size: 25px;
|
||||
color: #fff;
|
||||
background: #ff8eb3;
|
||||
|
||||
|
||||
}
|
||||
/*.af:hover{
|
||||
opacity: 0.8;
|
||||
}*/
|
||||
.title {
|
||||
font-size: 60px;
|
||||
color: #ff8eb3;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
input {
|
||||
|
||||
font-size: 25px;
|
||||
margin-top: 25px;
|
||||
border-top: none;
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
border-bottom: 3px solid #ff8eb3;
|
||||
color: #ff8eb3;
|
||||
}
|
||||
#touch {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
position: absolute;
|
||||
left: 300px;
|
||||
top: 79px;
|
||||
margin-left: -30px;
|
||||
margin-top: -30px;
|
||||
z-index: 999999;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#simple-menu {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
cursor: move;
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.wave-mask {
|
||||
position: absolute;
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
top: 10px;
|
||||
left: 55%;
|
||||
border-radius: 40%;
|
||||
background-color: rgba(212, 24, 24, 0.9);
|
||||
transform: translate(-50%, -70%) rotate(0);
|
||||
animation: toRotate 10s linear -5s infinite;
|
||||
z-index: 20;
|
||||
}
|
||||
|
||||
@keyframes toRotate {
|
||||
50% {
|
||||
transform: translate(-50%, -70%) rotate(180deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: translate(-50%, -70%) rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.container {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
border-radius: 50%;
|
||||
border: 3px solid #67c23a;
|
||||
background: #ffffff;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.wave {
|
||||
position: relative;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
background-image: linear-gradient(-180deg, #aaff80 13%, #67c23a 91%);
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.container {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.wave-mask {
|
||||
background-color: rgba(255, 255, 255, 0.9);
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h2>O.96OLED气象站设置平台</h2>
|
||||
<p></p>
|
||||
<h3>这里什么都没有</h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
|
||||
|
||||
|
||||
</html>
|
||||
247
源码/WeatherStation/zlt.h
Normal file
@ -0,0 +1,247 @@
|
||||
//width:128,height:64 联网成功等待请求显示的logo
|
||||
#ifndef SERIAL_DEBUG
|
||||
const unsigned char logo[] PROGMEM = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,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,0xC3,0xF1,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x80,0x07,0x30,0x00,0x00,
|
||||
0x60,0x20,0x99,0x01,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0xC0,0x04,0x30,0x00,0x00,
|
||||
0x60,0x30,0x18,0x03,0x00,0x00,0x00,0x30,0x03,0x00,0x00,0x60,0x00,0x30,0x00,0x00,
|
||||
0x60,0x30,0x18,0x03,0x44,0x8C,0xE1,0x78,0x1B,0x1C,0x0D,0x30,0x30,0xB3,0xC1,0x01,
|
||||
0x60,0x60,0x18,0x01,0xCC,0xC4,0xA2,0x31,0x37,0x36,0x0F,0x30,0x30,0x73,0x63,0x03,
|
||||
0xE0,0xC3,0x99,0x01,0xCC,0x64,0x06,0x33,0x63,0x23,0x03,0x30,0x30,0x33,0x36,0x02,
|
||||
0x60,0x80,0xF9,0x00,0xA8,0x64,0xC6,0x33,0x63,0x63,0x03,0x30,0x30,0x33,0x36,0x06,
|
||||
0x60,0x00,0x1B,0x00,0xA8,0xE7,0x27,0x33,0x63,0x7F,0x03,0x30,0x30,0x33,0xF6,0x07,
|
||||
0x60,0x00,0x1B,0x00,0x38,0x63,0x30,0x33,0x63,0x03,0x03,0x60,0x30,0x33,0x36,0x00,
|
||||
0x60,0xB0,0x19,0x00,0x38,0xC3,0xB0,0x33,0x63,0x06,0x03,0xE0,0xB4,0x73,0x63,0x00,
|
||||
0xE0,0xF7,0x18,0x00,0x10,0x83,0x63,0x63,0x63,0x3C,0x03,0x80,0xE7,0xB2,0xC1,0x03,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0xFC,0x03,0x00,0x00,0x00,0x00,0x00,0xF0,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,0xF0,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x07,0xE0,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x03,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x00,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0xE0,0x0F,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0xF8,0x07,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0xFE,0x07,0x00,0x00,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0xE0,0x01,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x80,0x07,0x00,0x00,0x00,0xC0,0x07,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x80,0x03,0x00,0x00,0x00,0xC0,0x1F,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0xC0,0x61,0x00,0x00,0x30,0x80,0x3F,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0xE0,0x60,0x00,0x00,0x30,0x00,0x78,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0xE0,0x60,0x00,0x00,0x30,0x00,0xF0,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0xE0,0x60,0x1C,0x0F,0x36,0x00,0xE0,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0xE0,0x60,0x36,0x19,0x3B,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0xE0,0x60,0x63,0xB0,0x31,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0xE0,0x60,0x63,0xBE,0x31,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0xE0,0x60,0x63,0xB3,0x31,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0xE0,0x60,0xE3,0xB1,0x31,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0xC0,0x61,0x36,0x39,0xBB,0xD9,0xC0,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0xC0,0x63,0x1C,0x37,0xB6,0xD9,0xC0,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x80,0x07,0x00,0x00,0x00,0x00,0xF0,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0xFC,0xFF,0xFF,0xFF,0xFF,0x1F,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0xF0,0xFF,0xFF,0xFF,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,0x86,0x01,0x00,0xC0,0x00,0x00,0x40,0x08,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x86,0x01,0x00,0x48,0x86,0xE7,0x43,0xFF,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x86,0x01,0x00,0x48,0x84,0x25,0x42,0x81,0x00,
|
||||
0x80,0x0E,0xCF,0x88,0x38,0x3A,0xC6,0x86,0x8D,0x31,0xFC,0x9F,0x25,0xF3,0xB5,0x00,
|
||||
0x80,0x9B,0x99,0x8C,0x6C,0x3E,0x62,0x87,0x1B,0x11,0x60,0x80,0xE7,0x43,0x66,0x00,
|
||||
0x80,0x91,0x90,0xDC,0x46,0x66,0x32,0x86,0x31,0x1B,0xE0,0x87,0x25,0xC2,0x43,0x00,
|
||||
0x80,0xF1,0xB0,0x54,0xC6,0x46,0x33,0x86,0x31,0x1B,0x30,0x86,0x25,0x73,0x00,0x00,
|
||||
0x80,0xF1,0xB0,0x55,0xFE,0x46,0x31,0x86,0x31,0x0A,0x78,0x82,0xE5,0x73,0x7F,0x00,
|
||||
0x80,0x91,0x10,0x73,0x06,0xC6,0x31,0x86,0x31,0x0E,0xCC,0x83,0x37,0x42,0x08,0x00,
|
||||
0x80,0x9B,0x19,0x73,0x0C,0x86,0x61,0x87,0x1B,0x0E,0x84,0x83,0x35,0x42,0x08,0x00,
|
||||
0x80,0x0F,0x0F,0x23,0x78,0x86,0xC0,0x86,0x0D,0x04,0x70,0x1E,0x10,0x63,0xFF,0x00,
|
||||
0x80,0x01,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0x06,0x18,0x00,0x88,0x23,0x00,0x00,
|
||||
0x80,0x01,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
/* (128 X 64 )*/
|
||||
|
||||
};
|
||||
|
||||
|
||||
#if 0
|
||||
|
||||
const unsigned char pctp[] PROGMEM = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x28,0x55,0x0A,0x00,0x00,0x00,0x00,0xFC,0xFF,0xFF,0x07,0x00,0x00,0x00,0x00,
|
||||
0x00,0x28,0x55,0x0A,0x00,0x00,0x00,0x00,0xFC,0xFF,0xFF,0x0F,0x00,0x00,0x00,0x00,
|
||||
0x00,0xE8,0xD5,0x0B,0x00,0x00,0x00,0x00,0x0C,0x00,0x00,0x0E,0x00,0x00,0x00,0x00,
|
||||
0x00,0xFC,0xFF,0x1F,0x00,0x00,0x00,0x00,0x0C,0x00,0x00,0x0C,0x00,0x00,0x00,0x00,
|
||||
0x80,0x07,0x00,0xF0,0x00,0x00,0x00,0x00,0x0C,0x00,0x00,0x0C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x04,0x00,0x10,0x00,0x00,0x00,0x00,0x0C,0x00,0x03,0x0C,0x00,0x00,0x00,0x00,
|
||||
0x80,0xC7,0xFF,0xF1,0x00,0x00,0x00,0x00,0x0C,0x80,0x03,0x0C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x64,0x00,0x13,0x00,0x00,0x00,0x00,0x0C,0x80,0x03,0x0C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x26,0x00,0x32,0x00,0x00,0x00,0x00,0x0C,0x80,0x03,0x0C,0x00,0x00,0x00,0x00,
|
||||
0x80,0x27,0x00,0xF2,0x00,0x00,0x00,0x00,0x0C,0x80,0x03,0x0C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x24,0x00,0x12,0x00,0x00,0x00,0x00,0x0C,0xC0,0x07,0x0C,0x00,0x00,0x00,0x00,
|
||||
0x80,0x27,0x00,0xF2,0x00,0x00,0x00,0x00,0xFC,0xC3,0x07,0x0C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x24,0x00,0x12,0x00,0x00,0x00,0x00,0xFC,0xCF,0x07,0x0C,0x00,0x00,0x00,0x00,
|
||||
0x80,0x27,0x00,0xF2,0x00,0x00,0x00,0x00,0xFC,0xCF,0xFE,0x0C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x24,0x00,0x12,0x00,0x00,0x00,0x00,0x0C,0xDC,0xFE,0x0C,0x00,0x00,0x00,0x00,
|
||||
0x80,0x27,0x00,0xF2,0x00,0x00,0x00,0x00,0x0C,0x78,0x00,0x0C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x26,0x00,0x32,0x00,0x00,0x00,0x00,0x0C,0x78,0x00,0x0C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x66,0x00,0x33,0x00,0x00,0x00,0x00,0x0C,0x78,0x00,0x0C,0x00,0x00,0x00,0x00,
|
||||
0x80,0xC7,0xFF,0xF1,0x00,0x00,0x00,0x00,0x0C,0xF0,0x26,0x0C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x04,0x00,0x10,0x00,0x00,0x00,0x00,0x0C,0xF0,0x26,0x0C,0x00,0x00,0x00,0x00,
|
||||
0x80,0x07,0x00,0xF0,0x00,0x00,0x00,0x00,0x0C,0xB0,0xBF,0x0F,0x00,0x00,0x00,0x00,
|
||||
0x00,0xFC,0xFF,0x1F,0x00,0x00,0x00,0x00,0x0C,0x80,0xBF,0x0C,0x00,0x00,0x00,0x00,
|
||||
0x00,0xA8,0xD5,0x0B,0x00,0x00,0x00,0x00,0x0C,0x80,0xE7,0x0C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x28,0x55,0x0A,0x00,0x00,0x00,0x00,0x0C,0x00,0xC4,0x0F,0x00,0x00,0x00,0x00,
|
||||
0x00,0x28,0x55,0x0A,0x00,0x00,0x00,0x00,0xFC,0xFF,0xFF,0x0F,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0xFF,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,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,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0xE0,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x60,0x00,0x00,0xCC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x60,0x60,0x00,0xCC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x60,0xF0,0x01,0xCC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x60,0x98,0x71,0xCC,0x00,0x00,0x00,0x00,0xFC,0xFF,0xFF,0x1F,0x00,0x00,0x00,0x00,
|
||||
0x60,0x98,0x01,0xCC,0x00,0x00,0x00,0x00,0xFC,0xFF,0xFF,0x1F,0x00,0x00,0x00,0x00,
|
||||
0x60,0x98,0x01,0xCC,0x00,0x00,0x00,0x00,0x0C,0x00,0x00,0x18,0x00,0x00,0x00,0x00,
|
||||
0x60,0xF8,0x71,0xCC,0x00,0x00,0x00,0x00,0xCC,0xFF,0xFF,0x19,0x00,0x00,0x00,0x00,
|
||||
0x60,0xB8,0x01,0xCC,0x00,0x00,0x00,0x00,0xEC,0xFF,0xFF,0x1B,0x00,0x00,0x00,0x00,
|
||||
0x60,0x98,0x01,0xCC,0x00,0x00,0x00,0x00,0x6C,0x10,0x04,0x1B,0x00,0x00,0x00,0x00,
|
||||
0x60,0x98,0x71,0xCC,0x00,0x00,0x00,0x00,0x6C,0x10,0x04,0x1B,0x00,0x00,0x00,0x00,
|
||||
0x60,0x98,0x01,0xCC,0x00,0x00,0x00,0x00,0x6C,0x10,0x04,0x1B,0x00,0x00,0x00,0x00,
|
||||
0x60,0x98,0x01,0xCC,0x00,0x00,0x00,0x00,0x6C,0x10,0x04,0x1B,0x00,0x00,0x00,0x00,
|
||||
0x60,0x98,0x71,0xCC,0x00,0x00,0x00,0x00,0x6C,0x10,0x0C,0x1B,0x00,0x00,0x00,0x00,
|
||||
0x60,0x98,0x01,0xCC,0x00,0x00,0x00,0x00,0xEC,0xFF,0xFF,0x1B,0x00,0x00,0x00,0x00,
|
||||
0x60,0x9C,0x03,0xCC,0x00,0x00,0x00,0x00,0x0C,0x00,0x00,0x18,0x00,0x00,0x00,0x00,
|
||||
0x60,0x0C,0x06,0xCC,0x00,0x00,0x00,0x00,0x0C,0x00,0x00,0x18,0x00,0x00,0x00,0x00,
|
||||
0x60,0x06,0x0E,0xCC,0x00,0x00,0x00,0x00,0xFC,0xFF,0xFF,0x1F,0x00,0x00,0x00,0x00,
|
||||
0x60,0x06,0x0E,0xCC,0x00,0x00,0x00,0x00,0xFC,0xFF,0xFF,0x1F,0x00,0x00,0x00,0x00,
|
||||
0x60,0x0C,0x07,0xCC,0x00,0x00,0x00,0x00,0x90,0x6C,0x9B,0x04,0x00,0x00,0x00,0x00,
|
||||
0x60,0xF8,0x03,0xCC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x60,0xE0,0x00,0xCC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x60,0x00,0x00,0xCC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0xE0,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0xE0,0xFF,0xFF,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,/* pc
|
||||
/* (128 X 64 )*/
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const unsigned char wx[] PROGMEM = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x81,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,
|
||||
0x00,0x00,0x81,0x00,0xFC,0x7F,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,
|
||||
0x00,0x80,0xFD,0x1F,0x04,0x61,0x00,0x00,0x03,0x00,0xDF,0x1D,0x1C,0x7C,0x00,0x70,
|
||||
0x00,0x80,0x80,0x00,0x04,0x61,0x00,0x00,0x03,0x00,0xCF,0x0C,0x0C,0x78,0x00,0x60,
|
||||
0x00,0xC0,0x80,0x00,0x84,0x61,0x00,0x00,0xE3,0x3F,0xF7,0x30,0x20,0x76,0xFE,0x63,
|
||||
0x00,0xC0,0xF8,0x1F,0xFC,0x7F,0x00,0x00,0xF3,0x3F,0xF3,0x30,0x70,0x66,0xFE,0x63,
|
||||
0x00,0xE0,0x88,0x18,0x04,0x61,0x00,0x00,0x73,0x30,0x73,0xF0,0x80,0x79,0x06,0x63,
|
||||
0x00,0xA0,0x88,0x18,0x04,0x61,0x00,0x00,0x33,0x30,0x33,0xF0,0x80,0x79,0x06,0x62,
|
||||
0x00,0x80,0xF8,0x1F,0x04,0x61,0x00,0x00,0x33,0x30,0x3F,0x08,0x7F,0x78,0x06,0x62,
|
||||
0x00,0x80,0xC0,0x01,0xFC,0x7F,0x00,0x00,0x33,0x30,0x3F,0x0C,0x7F,0x78,0x06,0x62,
|
||||
0x00,0x80,0x88,0x00,0x84,0x61,0x00,0x00,0x33,0x30,0x07,0x8E,0x00,0x7E,0x06,0x62,
|
||||
0x00,0x80,0x90,0x00,0x04,0x61,0x00,0x00,0x33,0x30,0x03,0xCF,0x00,0x7F,0x06,0x62,
|
||||
0x00,0x80,0xE0,0x00,0x06,0x61,0x00,0x00,0xF3,0x3F,0x23,0xCF,0x38,0x70,0xFE,0x63,
|
||||
0x00,0x80,0xE0,0x00,0x02,0x61,0x00,0x00,0xF3,0x3F,0x33,0xCF,0x7C,0x60,0xFE,0x63,
|
||||
0x00,0x80,0xA0,0x01,0x02,0x61,0x00,0x00,0x03,0x00,0x33,0x37,0x73,0x62,0x00,0x60,
|
||||
0x00,0x80,0x18,0x1E,0x83,0x31,0x00,0x00,0x03,0x00,0x33,0x33,0x63,0x67,0x00,0x60,
|
||||
0x00,0x80,0x04,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x03,0xFF,0x03,0xE0,0xFF,0x7F,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x03,0xFF,0x03,0xE0,0xFF,0x7F,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC7,0x7D,0x3C,0x7C,0x3C,0x78,0x70,0x7C,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC3,0x3C,0x3C,0x3C,0x7C,0x78,0x60,0x78,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xF0,0xF0,0xC0,0xF3,0x1F,0x9E,0x77,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xF0,0xF0,0xC0,0xE3,0x1F,0x9E,0x67,
|
||||
0x00,0x00,0x11,0x06,0x08,0x04,0x00,0x00,0x07,0x70,0x08,0x0F,0xCF,0x9D,0x1D,0x78,
|
||||
0x00,0x80,0x10,0x02,0x08,0x04,0x00,0x00,0x03,0x30,0x0C,0x0F,0x8F,0x99,0x19,0x78,
|
||||
0x00,0xC0,0x14,0x02,0xEC,0xFF,0x00,0x00,0xFF,0xFF,0xF3,0x80,0x60,0xE0,0x39,0x78,
|
||||
0x00,0x40,0x14,0x02,0x04,0x00,0x00,0x00,0xFF,0xFF,0xF3,0xC0,0x60,0xE0,0x79,0x78,
|
||||
0x00,0x00,0x75,0x3E,0x04,0x00,0x00,0x00,0xF7,0x1D,0xF0,0xE3,0x8F,0x1F,0x98,0x70,
|
||||
0x00,0x00,0x01,0x11,0xC6,0x7F,0x00,0x00,0xF3,0x0C,0xF0,0xF3,0x8F,0x1F,0x98,0x61,
|
||||
0x00,0x80,0x00,0x01,0x07,0x00,0x00,0x00,0x0F,0x80,0x08,0x03,0x8C,0x81,0xFF,0x7F,
|
||||
0x00,0xC0,0xFC,0x09,0x05,0x00,0x00,0x00,0x0F,0xC0,0x0C,0x03,0xC8,0x81,0xFF,0x7F,
|
||||
0x00,0xC0,0x00,0x0B,0xC4,0x7F,0x00,0x00,0x0F,0x3E,0x0C,0xE0,0x0F,0xE2,0x1D,0x70,
|
||||
0x00,0x80,0x38,0x0A,0x04,0x00,0x00,0x00,0x0F,0x3F,0x0C,0xF0,0x0F,0xE6,0x19,0x60,
|
||||
0x00,0x80,0x2C,0x0A,0x04,0x00,0x00,0x00,0xFF,0xC7,0x83,0xC3,0x0D,0xF8,0x87,0x78,
|
||||
0x00,0x80,0x24,0x0E,0xC4,0x40,0x00,0x00,0xFF,0xC3,0xC3,0x83,0x1C,0xF8,0x87,0x79,
|
||||
0x00,0x80,0xE4,0x04,0x44,0x40,0x00,0x00,0xFF,0x0D,0xCF,0xE3,0x00,0xD8,0xFF,0x79,
|
||||
0x00,0x80,0x64,0x0E,0x44,0x40,0x00,0x00,0xFF,0x0C,0xCF,0xF3,0x00,0x88,0xFF,0x79,
|
||||
0x00,0x80,0x26,0x19,0xC4,0x7F,0x00,0x00,0xFF,0x01,0xDC,0xF1,0x00,0x1C,0xDF,0x71,
|
||||
0x00,0x80,0xC0,0x30,0x44,0x40,0x00,0x00,0xFF,0xF3,0xFC,0xF0,0xC0,0x7F,0x9E,0x67,
|
||||
0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0xFF,0xF3,0xFC,0xF1,0x80,0x7F,0xDF,0x63,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF3,0x30,0xFC,0x3F,0xDF,0xE7,0xE7,0x61,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF7,0x70,0xF8,0x7F,0x8F,0xE3,0xF7,0x61,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFC,0x00,0xFC,0x00,0x00,0xF8,0x61,
|
||||
0xC0,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0xFF,0xFD,0x00,0xFC,0x00,0x00,0xF8,0x71,
|
||||
0xC0,0xF8,0x07,0x00,0x00,0x10,0xFF,0x01,0xF3,0x03,0xFC,0x33,0xF7,0x01,0x60,0x7E,
|
||||
0xC0,0x00,0x04,0x00,0x00,0x10,0x80,0x01,0xF7,0x07,0xFC,0x33,0xE2,0x00,0x60,0x7E,
|
||||
0xC0,0x00,0x04,0x00,0x00,0x18,0x80,0x01,0xFF,0xFF,0xF3,0x33,0x30,0xE0,0x67,0x60,
|
||||
0xF8,0x03,0x04,0x00,0x00,0xFE,0x80,0x01,0xFF,0xFF,0xF3,0x37,0x60,0xE0,0x67,0x70,
|
||||
0xC0,0x00,0x04,0x00,0x00,0x10,0x80,0x01,0x03,0x00,0xF3,0x0F,0x87,0x67,0xE6,0x79,
|
||||
0xC0,0x00,0x04,0x00,0x00,0x10,0x80,0x01,0x03,0x00,0xF7,0x0F,0xC2,0x63,0xE7,0x78,
|
||||
0xC0,0xF2,0xC7,0xFF,0x7F,0x50,0xFE,0x01,0xF3,0x3F,0xFF,0x00,0xF0,0xE1,0x07,0x78,
|
||||
0xC0,0x01,0xC4,0xFF,0x7F,0x38,0x80,0x01,0xF3,0x3F,0xFF,0x01,0xE0,0xE1,0x03,0x78,
|
||||
0xF0,0x00,0x04,0x00,0x00,0x1E,0x80,0x01,0x33,0x30,0xCF,0xCF,0x1F,0x06,0xE0,0x61,
|
||||
0xD0,0x00,0x04,0x00,0x00,0x12,0x80,0x01,0x33,0x30,0xCF,0xCF,0x0F,0x06,0xE0,0x71,
|
||||
0xC0,0x00,0x04,0x00,0x00,0x10,0x80,0x01,0x33,0x30,0xC3,0xC0,0x03,0x66,0x06,0x7E,
|
||||
0xC0,0x00,0x04,0x00,0x00,0x10,0x80,0x01,0x33,0x30,0xC7,0xC0,0x03,0x62,0x07,0x7E,
|
||||
0xC0,0xF8,0x07,0x00,0x00,0x10,0xFF,0x01,0x33,0x30,0xFF,0xCC,0x73,0xE0,0x07,0x66,
|
||||
0xC0,0x00,0x04,0x00,0x00,0x10,0x80,0x01,0x73,0x30,0xFF,0x8C,0x63,0xE0,0x07,0x76,
|
||||
0xE0,0x00,0x04,0x00,0x00,0x1C,0x80,0x01,0xF3,0x3F,0x03,0x0F,0x9C,0x01,0xFE,0x79,
|
||||
0x20,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x03,0x00,0x03,0x1F,0x8C,0x01,0xFE,0x79,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0xC3,0x3F,0x83,0x87,0x99,0x79,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0xC7,0x7F,0xC7,0xC7,0xDD,0x7D,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//data
|
||||
|
||||
const unsigned char col_ssd[] PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xe0,0x1f,0x00,0xee,0x78,0x3c,0x00,0xc6,0x18,0x70,0x00,0xc6,0x0c,0x60,0x00,0xc6,0x0e,0x00,0x00,0xee,0x0e,0x00,0x00,0x7c,0x06,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x0e,0x00,0x00,0x00,0x0e,0x60,0x00,0x00,0x1c,0x70,0x00,0x00,0x18,0x30,0x00,0x00,0x78,0x3c,0x00,0x00,0xe0,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
const unsigned char col_100[] PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x04,0x18,0x20,0x00,0x00,0x0e,0x00,0x70,0x00,0x00,0x1c,0x00,0x38,0x00,0x00,0x18,0x3c,0x18,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xc0,0xe7,0x03,0x00,0x00,0xe0,0x81,0x03,0x00,0x00,0xe0,0x00,0x07,0x00,0x00,0x70,0x00,0x06,0x00,0x00,0x30,0x00,0x0e,0x00,0xe0,0x31,0x00,0x8c,0x03,0xe0,0x31,0x00,0xcc,0x07,0x00,0x30,0x00,0x0c,0x00,0x00,0x70,0x00,0x0e,0x00,0x00,0x70,0x00,0x06,0x00,0x00,0xe0,0x00,0x07,0x00,0x00,0xc0,0xc3,0x03,0x00,0x00,0x80,0xff,0x01,0x00,0x00,0x08,0xff,0x10,0x00,0x00,0x1c,0x00,0x38,0x00,0x00,0x0e,0x00,0x70,0x00,0x00,0x06,0x00,0x60,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
const unsigned char col_102[] PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xc0,0xff,0x01,0x00,0x00,0xe0,0x81,0x03,0x00,0x00,0x70,0x00,0x0f,0x00,0x00,0x3f,0x00,0xfe,0x00,0x80,0x3f,0x00,0xfc,0x01,0xc0,0x01,0x00,0x80,0x03,0xe0,0x00,0x00,0x00,0x03,0x60,0x00,0x00,0x00,0x07,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x07,0xc0,0x00,0x00,0x80,0x03,0xc0,0x63,0x00,0xc6,0x01,0x80,0xff,0x00,0xff,0x00,0x00,0xfe,0xe3,0x3f,0x00,0x00,0x80,0xff,0x01,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
const unsigned char col_103[] PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x03,0x80,0x03,0x00,0x00,0x07,0x80,0x03,0x00,0x00,0xc6,0x8f,0x01,0x00,0x00,0xf0,0x3f,0x00,0x00,0x00,0x78,0x78,0x00,0x00,0x00,0x38,0x70,0x00,0x00,0x00,0x1c,0x60,0x00,0x00,0xe0,0x1c,0xfe,0x1c,0x00,0xf0,0x8d,0xff,0x1e,0x00,0xe0,0xdc,0xff,0x1f,0x00,0x00,0xfc,0x81,0x07,0x00,0x00,0x7e,0x00,0x7f,0x00,0x80,0x3f,0x00,0xfe,0x00,0xc0,0x13,0x00,0xe4,0x03,0xe0,0x00,0x00,0x80,0x03,0xe0,0x00,0x00,0x00,0x07,0x60,0x00,0x00,0x00,0x07,0x70,0x00,0x00,0x00,0x06,0x70,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x07,0xe0,0x00,0x00,0x00,0x03,0xe0,0x01,0x00,0x82,0x03,0xc0,0x7f,0x00,0xff,0x01,0x00,0xff,0x81,0xff,0x00,0x00,0xdc,0xff,0x39,0x00,0x00,0x80,0xff,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
const unsigned char col_104[] PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x0e,0x00,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x00,0x1c,0x10,0x06,0x00,0x00,0x10,0xfe,0x3f,0x00,0x00,0x80,0xff,0x7f,0x00,0x00,0xc0,0xff,0xff,0x00,0x00,0xc0,0xf9,0xff,0x01,0x00,0xe0,0xfc,0xff,0x03,0x00,0x60,0xfc,0xff,0x03,0x00,0x70,0xfe,0xff,0x03,0xe0,0x71,0xfe,0xff,0x07,0xe0,0x73,0xfe,0xff,0x03,0x00,0x70,0xfe,0xff,0x07,0x00,0x70,0xfe,0xff,0x03,0x00,0x60,0xfc,0xff,0x03,0x00,0xe0,0xfc,0xff,0x03,0x00,0xc0,0xf9,0xff,0x01,0x00,0x80,0xff,0xff,0x00,0x00,0x00,0xff,0x7f,0x00,0x00,0x18,0xfc,0x1f,0x00,0x00,0x1c,0x00,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x00,0x0e,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
//const unsigned char col_205[] U8X8_PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0xf0,0x61,0x00,0x00,0xe0,0xdf,0x63,0x00,0x00,0xff,0x83,0x66,0x00,0x80,0x13,0xc3,0x66,0x00,0x80,0x10,0x41,0x6c,0x00,0xc0,0x10,0x41,0x7c,0x00,0x80,0x18,0x41,0x74,0x00,0xc0,0x18,0x41,0x7c,0x00,0x80,0x10,0x41,0x6c,0x00,0x80,0x11,0xc3,0x66,0x00,0x00,0x7f,0x83,0x66,0x00,0x00,0xe0,0x9f,0x63,0x00,0x00,0x00,0xfc,0x63,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0xfc,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};
|
||||
//const unsigned char col_208[] U8X8_PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0x03,0xe0,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0x03,0x00,0xfe,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0x1f,0x00,0xc0,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0x03,0x00,0xf8,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x3f,0x00,0x00,0x00,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x03,0x00,0x00,0x00,0xfe,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
const unsigned char col_301[] PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0x03,0x01,0x00,0x00,0x03,0x80,0x03,0x00,0x00,0x07,0xc0,0x01,0x00,0x00,0xe6,0x8f,0x00,0x00,0x00,0xf0,0x3f,0x00,0x00,0x00,0x78,0x38,0x00,0x00,0x00,0x38,0x70,0x00,0x00,0x00,0x1c,0x60,0x00,0x00,0xe0,0x0c,0xfe,0x1c,0x00,0xf0,0x8c,0xff,0x1e,0x00,0x00,0xec,0xf7,0x03,0x00,0x00,0xfc,0x80,0x07,0x00,0x00,0x7e,0x00,0x7f,0x00,0x80,0x3f,0x00,0xfe,0x00,0xc0,0x13,0x00,0xe4,0x01,0xe0,0x00,0x00,0x80,0x03,0x60,0x00,0x00,0x00,0x07,0x70,0x00,0x00,0x00,0x07,0x70,0x00,0x00,0x00,0x07,0x70,0x00,0x00,0x00,0x07,0x60,0x00,0x00,0x00,0x07,0xe0,0x00,0x08,0x80,0x03,0xc0,0x21,0x18,0xc2,0x03,0xc0,0x7f,0x1c,0xff,0x01,0x00,0xff,0xbc,0xff,0x00,0x00,0xcc,0xbc,0x19,0x00,0x00,0x04,0x3c,0x20,0x00,0x00,0x0e,0x08,0x30,0x00,0x00,0x0e,0xc1,0x78,0x00,0x00,0x1e,0xc3,0x78,0x00,0x00,0x9e,0xe7,0x79,0x00,0x00,0x9e,0xe7,0x79,0x00,0x00,0x80,0xe7,0x01,0x00,0x00,0x80,0xe7,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
const unsigned char col_302[] PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x00,0x00,0x00,0x80,0xff,0x01,0x00,0x00,0xe0,0xff,0x03,0x00,0x00,0xe0,0xc3,0x07,0x00,0x00,0xfe,0x00,0x7f,0x00,0x80,0x7f,0x00,0xfe,0x01,0xc0,0x3f,0x00,0xfc,0x03,0xe0,0x01,0x00,0xc0,0x07,0xe0,0x00,0x00,0x00,0x07,0xf0,0x00,0x00,0x00,0x07,0x70,0x00,0x00,0x00,0x0f,0x70,0x00,0x00,0x00,0x0f,0xf0,0x00,0x00,0x00,0x07,0xe0,0x00,0x00,0x00,0x07,0xe0,0x61,0x00,0x82,0x07,0xc0,0x7f,0x20,0xff,0x03,0x80,0xff,0xb1,0xff,0x01,0x00,0xff,0xbb,0x7f,0x00,0x00,0x80,0xdd,0x01,0x00,0x00,0x30,0x5e,0x03,0x00,0x00,0x70,0x1f,0x03,0x00,0x00,0x78,0x9f,0x07,0x00,0x00,0x78,0xbe,0x07,0x00,0x00,0xf8,0xfe,0x07,0x00,0x00,0x78,0x9e,0x07,0x00,0x00,0x30,0x0e,0x03,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
const unsigned char col_304[] PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x80,0xff,0x00,0x00,0x00,0xc0,0xff,0x03,0x00,0x00,0xe0,0x81,0x07,0x00,0x00,0x7e,0x00,0x7f,0x00,0x80,0x3f,0x00,0xfe,0x01,0xc0,0x37,0x00,0xec,0x03,0xe0,0x01,0x00,0x80,0x03,0xe0,0x00,0x00,0x00,0x07,0x60,0x00,0x00,0x00,0x07,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x07,0xe0,0x00,0x00,0x00,0x07,0xe0,0x01,0x00,0x80,0x03,0xc0,0x7f,0x00,0xff,0x03,0x80,0xff,0x81,0xff,0x00,0x00,0xfe,0xff,0x7f,0x00,0x00,0x80,0xff,0x00,0x00,0x00,0x0e,0x3e,0x70,0x00,0x00,0x0f,0x00,0x78,0x00,0x00,0x1f,0x1c,0x78,0x00,0x00,0x0e,0x3c,0x78,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x07,0x00,0x00,0xf0,0x81,0x0f,0x00,0x00,0xf0,0x80,0x0f,0x00,0x00,0xe0,0x00,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};
|
||||
const unsigned char col_307[] PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x80,0xff,0x00,0x00,0x00,0xc0,0xff,0x03,0x00,0x00,0xe0,0x81,0x07,0x00,0x00,0x7c,0x00,0x3f,0x00,0x80,0x3f,0x00,0xfe,0x00,0xc0,0x1f,0x00,0xfc,0x01,0xc0,0x01,0x00,0x80,0x03,0xe0,0x00,0x00,0x00,0x03,0x60,0x00,0x00,0x00,0x07,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x07,0xe0,0x00,0x00,0x00,0x07,0xe0,0x01,0x00,0x80,0x03,0xc0,0x77,0x00,0xe6,0x01,0x80,0xff,0x81,0xff,0x00,0x00,0xfe,0xff,0x3f,0x00,0x00,0x80,0xff,0x01,0x00,0x00,0x01,0x3c,0xc2,0x00,0x80,0x63,0x00,0xc3,0x01,0x80,0xe3,0x00,0xe7,0x01,0xc0,0xf3,0x00,0xe7,0x01,0x80,0xf3,0x80,0xef,0x01,0x00,0xf0,0x18,0x07,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
const unsigned char col_310[] PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xc0,0xff,0x01,0x00,0x00,0xe0,0x81,0x07,0x00,0x00,0x70,0x00,0x2f,0x00,0x00,0x3f,0x00,0xfe,0x00,0xc0,0x17,0x00,0xfc,0x01,0xc0,0x01,0x00,0x80,0x03,0xe0,0x00,0x00,0x00,0x03,0x60,0x00,0x00,0x00,0x07,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x07,0xe0,0x00,0x00,0x00,0x03,0xc0,0x01,0x00,0x80,0x03,0xc0,0x63,0x00,0xe6,0x01,0x80,0xff,0x80,0xff,0x00,0x00,0xcc,0xf7,0x1b,0x00,0x00,0x80,0xff,0x00,0x00,0x00,0x01,0x84,0xc0,0x00,0x80,0x83,0x81,0xc0,0x01,0x80,0x83,0xc1,0xe1,0x01,0xc0,0xc3,0xc3,0xe1,0x01,0x80,0xc3,0xc3,0xeb,0x01,0x00,0xd8,0xcb,0x0d,0x00,0x00,0x38,0x1c,0x1c,0x00,0x00,0x3c,0x1c,0x1e,0x00,0x00,0x3c,0x3c,0x1e,0x00,0x00,0x18,0x1c,0x1c,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
const unsigned char col_401[] PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xc0,0xc3,0x01,0x00,0x00,0x60,0x00,0x03,0x00,0x00,0x38,0x00,0x06,0x00,0x80,0x3f,0x00,0xfc,0x00,0xc0,0x01,0x00,0xc0,0x01,0xc0,0x00,0x00,0x00,0x03,0x60,0x00,0x00,0x00,0x03,0x20,0x00,0x00,0x00,0x02,0x20,0x00,0x00,0x00,0x02,0x20,0x00,0x00,0x00,0x02,0x60,0x00,0x00,0x00,0x02,0x60,0x00,0x00,0x00,0x03,0xc0,0x00,0x00,0x80,0x01,0x80,0x73,0x00,0xe6,0x00,0x00,0xff,0x80,0x7f,0x00,0x00,0xc0,0xff,0x01,0x00,0x00,0x00,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x00,0x0e,0x00,0x00,0x38,0x00,0x0e,0x00,0x00,0x7c,0x00,0x1f,0x00,0x00,0x38,0x00,0x0c,0x00,0x00,0x28,0x14,0x00,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
const unsigned char col_407[] PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x80,0x03,0x00,0x00,0x06,0x80,0x01,0x00,0x00,0xc0,0x0f,0x00,0x00,0x00,0xf0,0x3c,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x18,0x60,0x00,0x00,0x00,0x08,0x40,0x00,0x00,0xe0,0x08,0x78,0x1c,0x00,0xe0,0x88,0xff,0x1e,0x00,0x00,0xc8,0x81,0x03,0x00,0x00,0x78,0x00,0x07,0x00,0x00,0x3e,0x00,0x7e,0x00,0x80,0x3f,0x00,0xfc,0x01,0xc0,0x01,0x00,0x80,0x03,0xc0,0x00,0x00,0x00,0x03,0x60,0x00,0x00,0x00,0x02,0x60,0x00,0x00,0x00,0x06,0x20,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x06,0x60,0x00,0x00,0x00,0x02,0xc0,0x00,0x00,0x00,0x03,0xc0,0x01,0x00,0x80,0x01,0x80,0x7f,0x24,0xfe,0x00,0x00,0xfe,0x3c,0x3f,0x00,0x00,0x00,0x1c,0x01,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x00,0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
const unsigned char col_500[] PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xc0,0xc3,0x03,0x00,0x00,0xe0,0x00,0x07,0x00,0x00,0x70,0x00,0x06,0x00,0xe0,0xff,0x0f,0x0c,0x00,0x00,0x18,0x00,0x0c,0x00,0x00,0x18,0x00,0x08,0x00,0x00,0x18,0x00,0x18,0x00,0x80,0xff,0xff,0xff,0x03,0x00,0x18,0x00,0x18,0x00,0x00,0x18,0x00,0x08,0x00,0x00,0x38,0x00,0x0c,0x00,0xe0,0xff,0xff,0x3f,0x00,0x00,0xe0,0x00,0x07,0x00,0x00,0xe0,0x00,0x03,0x00,0x00,0x80,0xe7,0x01,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};
|
||||
const unsigned char col_503[] PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x0c,0x10,0x38,0x00,0x00,0x0e,0x18,0xf0,0x00,0x00,0x00,0x00,0xf0,0x01,0x00,0x00,0x00,0xe0,0x03,0x00,0x80,0x03,0xe0,0x03,0xc0,0x80,0x03,0xe0,0x07,0xc0,0x00,0xc0,0xf0,0x07,0x00,0x00,0xc0,0xf0,0x03,0x00,0x30,0x00,0xf8,0x03,0x00,0x30,0x00,0xfe,0x01,0x00,0x30,0x80,0xff,0x00,0x00,0x00,0xf0,0xff,0x00,0xc0,0xff,0xff,0xf7,0x00,0x00,0xfe,0xff,0xf0,0x00,0x00,0x00,0x00,0xf8,0x00,0x00,0x30,0x18,0xfc,0x00,0x00,0x30,0x18,0x7e,0x00,0x00,0x00,0xc0,0x3f,0x00,0x00,0xf8,0xff,0x3f,0x00,0x00,0x80,0x7f,0x38,0x00,0x00,0x00,0x01,0x3c,0x00,0x00,0x80,0x01,0x1f,0x00,0x00,0x80,0xc1,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};
|
||||
const unsigned char col_509[] PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,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,0x7f,0x00,0x00,0xfe,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0x7f,0x00,0x00,0xfe,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0x7f,0x00,0x00,0xfe,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0x7f,0x00,0x00,0xfe,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0x7f,0x00,0x00,0xfe,0xff,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};
|
||||
const unsigned char col_999[] PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,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,0x00,0x00,0xc0,0xc1,0xc1,0xf0,0x00,0xc0,0xc1,0xe1,0xf0,0x00,0xc0,0xc3,0x61,0xf0,0x00,0xc0,0xc7,0x61,0xf8,0x01,0xc0,0xc7,0x71,0xf8,0x01,0xc0,0xcf,0x31,0xb8,0x03,0xc0,0xdf,0x31,0x9c,0x03,0xc0,0xfd,0x39,0x9c,0x03,0xc0,0xf9,0x19,0xfc,0x07,0xc0,0xf9,0x19,0xfe,0x07,0xc0,0xf1,0x1d,0xfe,0x07,0xc0,0xe1,0x0d,0x0e,0x0f,0xc0,0xe1,0x0d,0x07,0x0e,0x00,0x00,0x0e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
|
||||
#endif
|
||||
99
源码/libraries/Time/DateStrings.cpp
Normal file
@ -0,0 +1,99 @@
|
||||
/* DateStrings.cpp
|
||||
* Definitions for date strings for use with the Time library
|
||||
*
|
||||
* Updated for Arduino 1.5.7 18 July 2014
|
||||
*
|
||||
* No memory is consumed in the sketch if your code does not call any of the string methods
|
||||
* You can change the text of the strings, make sure the short strings are each exactly 3 characters
|
||||
* the long strings can be any length up to the constant dt_MAX_STRING_LEN defined in TimeLib.h
|
||||
*
|
||||
*/
|
||||
|
||||
#if defined(__AVR__)
|
||||
#include <avr/pgmspace.h>
|
||||
#else
|
||||
// for compatiblity with Arduino Due and Teensy 3.0 and maybe others?
|
||||
#define PROGMEM
|
||||
#define PGM_P const char *
|
||||
#define pgm_read_byte(addr) (*(const unsigned char *)(addr))
|
||||
#define pgm_read_word(addr) (*(const unsigned char **)(addr))
|
||||
#ifndef strcpy_P
|
||||
#define strcpy_P(dest, src) strcpy((dest), (src))
|
||||
#endif
|
||||
#endif
|
||||
#include <string.h> // for strcpy_P or strcpy
|
||||
#include "TimeLib.h"
|
||||
|
||||
// the short strings for each day or month must be exactly dt_SHORT_STR_LEN
|
||||
#define dt_SHORT_STR_LEN 3 // the length of short strings
|
||||
|
||||
static char buffer[dt_MAX_STRING_LEN+1]; // must be big enough for longest string and the terminating null
|
||||
|
||||
const char monthStr0[] PROGMEM = "";
|
||||
const char monthStr1[] PROGMEM = "January";
|
||||
const char monthStr2[] PROGMEM = "February";
|
||||
const char monthStr3[] PROGMEM = "March";
|
||||
const char monthStr4[] PROGMEM = "April";
|
||||
const char monthStr5[] PROGMEM = "May";
|
||||
const char monthStr6[] PROGMEM = "June";
|
||||
const char monthStr7[] PROGMEM = "July";
|
||||
const char monthStr8[] PROGMEM = "August";
|
||||
const char monthStr9[] PROGMEM = "September";
|
||||
const char monthStr10[] PROGMEM = "October";
|
||||
const char monthStr11[] PROGMEM = "November";
|
||||
const char monthStr12[] PROGMEM = "December";
|
||||
|
||||
const PROGMEM char * const PROGMEM monthNames_P[] =
|
||||
{
|
||||
monthStr0,monthStr1,monthStr2,monthStr3,monthStr4,monthStr5,monthStr6,
|
||||
monthStr7,monthStr8,monthStr9,monthStr10,monthStr11,monthStr12
|
||||
};
|
||||
|
||||
const char monthShortNames_P[] PROGMEM = "ErrJanFebMarAprMayJunJulAugSepOctNovDec";
|
||||
|
||||
const char dayStr0[] PROGMEM = "Err";
|
||||
const char dayStr1[] PROGMEM = "Sunday";
|
||||
const char dayStr2[] PROGMEM = "Monday";
|
||||
const char dayStr3[] PROGMEM = "Tuesday";
|
||||
const char dayStr4[] PROGMEM = "Wednesday";
|
||||
const char dayStr5[] PROGMEM = "Thursday";
|
||||
const char dayStr6[] PROGMEM = "Friday";
|
||||
const char dayStr7[] PROGMEM = "Saturday";
|
||||
|
||||
const PROGMEM char * const PROGMEM dayNames_P[] =
|
||||
{
|
||||
dayStr0,dayStr1,dayStr2,dayStr3,dayStr4,dayStr5,dayStr6,dayStr7
|
||||
};
|
||||
|
||||
const char dayShortNames_P[] PROGMEM = "ErrSunMonTueWedThuFriSat";
|
||||
|
||||
/* functions to return date strings */
|
||||
|
||||
char* monthStr(uint8_t month)
|
||||
{
|
||||
strcpy_P(buffer, (PGM_P)pgm_read_word(&(monthNames_P[month])));
|
||||
return buffer;
|
||||
}
|
||||
|
||||
char* monthShortStr(uint8_t month)
|
||||
{
|
||||
for (int i=0; i < dt_SHORT_STR_LEN; i++)
|
||||
buffer[i] = pgm_read_byte(&(monthShortNames_P[i+ (month*dt_SHORT_STR_LEN)]));
|
||||
buffer[dt_SHORT_STR_LEN] = 0;
|
||||
return buffer;
|
||||
}
|
||||
|
||||
char* dayStr(uint8_t day)
|
||||
{
|
||||
strcpy_P(buffer, (PGM_P)pgm_read_word(&(dayNames_P[day])));
|
||||
return buffer;
|
||||
}
|
||||
|
||||
char* dayShortStr(uint8_t day)
|
||||
{
|
||||
uint8_t index = day*dt_SHORT_STR_LEN;
|
||||
for (int i=0; i < dt_SHORT_STR_LEN; i++)
|
||||
buffer[i] = pgm_read_byte(&(dayShortNames_P[index + i]));
|
||||
buffer[dt_SHORT_STR_LEN] = 0;
|
||||
return buffer;
|
||||
}
|
||||
155
源码/libraries/Time/Readme.md
Normal file
@ -0,0 +1,155 @@
|
||||
# Arduino Time Library
|
||||
|
||||
Time is a library that provides timekeeping functionality for Arduino.
|
||||
|
||||
The code is derived from the Playground DateTime library but is updated
|
||||
to provide an API that is more flexible and easier to use.
|
||||
|
||||
A primary goal was to enable date and time functionality that can be used with
|
||||
a variety of external time sources with minimum differences required in sketch logic.
|
||||
|
||||
Example sketches illustrate how similar sketch code can be used with: a Real Time Clock,
|
||||
internet NTP time service, GPS time data, and Serial time messages from a computer
|
||||
for time synchronization.
|
||||
|
||||
## Functionality
|
||||
|
||||
The functions available in the library include
|
||||
|
||||
```c
|
||||
hour(); // the hour now (0-23)
|
||||
minute(); // the minute now (0-59)
|
||||
second(); // the second now (0-59)
|
||||
day(); // the day now (1-31)
|
||||
weekday(); // day of the week (1-7), Sunday is day 1
|
||||
month(); // the month now (1-12)
|
||||
year(); // the full four digit year: (2009, 2010 etc)
|
||||
```
|
||||
|
||||
there are also functions to return the hour in 12-hour format
|
||||
|
||||
```c
|
||||
hourFormat12(); // the hour now in 12 hour format
|
||||
isAM(); // returns true if time now is AM
|
||||
isPM(); // returns true if time now is PM
|
||||
|
||||
now(); // returns the current time as seconds since Jan 1 1970
|
||||
```
|
||||
|
||||
The time and date functions can take an optional parameter for the time. This prevents
|
||||
errors if the time rolls over between elements. For example, if a new minute begins
|
||||
between getting the minute and second, the values will be inconsistent. Using the
|
||||
following functions eliminates this problem
|
||||
|
||||
```c
|
||||
time_t t = now(); // store the current time in time variable t
|
||||
hour(t); // returns the hour for the given time t
|
||||
minute(t); // returns the minute for the given time t
|
||||
second(t); // returns the second for the given time t
|
||||
day(t); // the day for the given time t
|
||||
weekday(t); // day of the week for the given time t
|
||||
month(t); // the month for the given time t
|
||||
year(t); // the year for the given time t
|
||||
```
|
||||
|
||||
Functions for managing the timer services are:
|
||||
|
||||
```c
|
||||
setTime(t); // set the system time to the give time t
|
||||
setTime(hr,min,sec,day,mnth,yr); // alternative to above, yr is 2 or 4 digit yr
|
||||
// (2010 or 10 sets year to 2010)
|
||||
adjustTime(adjustment); // adjust system time by adding the adjustment value
|
||||
timeStatus(); // indicates if time has been set and recently synchronized
|
||||
// returns one of the following enumerations:
|
||||
timeNotSet // the time has never been set, the clock started on Jan 1, 1970
|
||||
timeNeedsSync // the time had been set but a sync attempt did not succeed
|
||||
timeSet // the time is set and is synced
|
||||
```
|
||||
|
||||
Time and Date values are not valid if the status is timeNotSet. Otherwise, values can be used but
|
||||
the returned time may have drifted if the status is timeNeedsSync.
|
||||
|
||||
```c
|
||||
setSyncProvider(getTimeFunction); // set the external time provider
|
||||
setSyncInterval(interval); // set the number of seconds between re-sync
|
||||
```
|
||||
|
||||
There are many convenience macros in the `time.h` file for time constants and conversion
|
||||
of time units.
|
||||
|
||||
To use the library, copy the download to the Library directory.
|
||||
|
||||
## Examples
|
||||
|
||||
The Time directory contains the Time library and some example sketches
|
||||
illustrating how the library can be used with various time sources:
|
||||
|
||||
- `TimeSerial.pde` shows Arduino as a clock without external hardware.
|
||||
It is synchronized by time messages sent over the serial port.
|
||||
A companion Processing sketch will automatically provide these messages
|
||||
if it is running and connected to the Arduino serial port.
|
||||
|
||||
- `TimeSerialDateStrings.pde` adds day and month name strings to the sketch above
|
||||
Short (3 characters) and long strings are available to print the days of
|
||||
the week and names of the months.
|
||||
|
||||
- `TimeRTC` uses a DS1307 real-time clock to provide time synchronization.
|
||||
A basic RTC library named DS1307RTC is included in the download.
|
||||
To run this sketch the DS1307RTC library must be installed.
|
||||
|
||||
- `TimeRTCSet` is similar to the above and adds the ability to set the Real Time Clock
|
||||
|
||||
- `TimeRTCLog` demonstrates how to calculate the difference between times.
|
||||
It is a very simple logger application that monitors events on digital pins
|
||||
and prints (to the serial port) the time of an event and the time period since
|
||||
the previous event.
|
||||
|
||||
- `TimeNTP` uses the Arduino Ethernet shield to access time using the internet NTP time service.
|
||||
The NTP protocol uses UDP and the UdpBytewise library is required, see:
|
||||
http://bitbucket.org/bjoern/arduino_osc/src/14667490521f/libraries/Ethernet/
|
||||
|
||||
- `TimeGPS` gets time from a GPS
|
||||
This requires the TinyGPS library from Mikal Hart:
|
||||
http://arduiniana.org/libraries/TinyGPS
|
||||
|
||||
## Differences
|
||||
|
||||
Differences between this code and the playground DateTime library
|
||||
although the Time library is based on the DateTime codebase, the API has changed.
|
||||
Changes in the Time library API:
|
||||
|
||||
- time elements are functions returning `int` (they are variables in DateTime)
|
||||
- Years start from 1970
|
||||
- days of the week and months start from 1 (they start from 0 in DateTime)
|
||||
- DateStrings do not require a separate library
|
||||
- time elements can be accessed non-atomically (in DateTime they are always atomic)
|
||||
- function added to automatically sync time with external source
|
||||
- `localTime` and `maketime` parameters changed, `localTime` renamed to `breakTime`
|
||||
|
||||
## Technical notes:
|
||||
|
||||
Internal system time is based on the standard Unix `time_t`.
|
||||
The value is the number of seconds since Jan 1, 1970.
|
||||
System time begins at zero when the sketch starts.
|
||||
|
||||
The internal time can be automatically synchronized at regular intervals to an external time source.
|
||||
This is enabled by calling the `setSyncProvider(provider)` function - the provider argument is
|
||||
the address of a function that returns the current time as a `time_t`.
|
||||
See the sketches in the examples directory for usage.
|
||||
|
||||
The default interval for re-syncing the time is 5 minutes but can be changed by calling the
|
||||
`setSyncInterval(interval)` method to set the number of seconds between re-sync attempts.
|
||||
|
||||
The Time library defines a structure for holding time elements that is a compact version of the C tm structure.
|
||||
All the members of the Arduino tm structure are bytes and the year is offset from 1970.
|
||||
Convenience macros provide conversion to and from the Arduino format.
|
||||
|
||||
Low level functions to convert between system time and individual time elements are provided:
|
||||
|
||||
```c
|
||||
breakTime(time, &tm); // break time_t into elements stored in tm struct
|
||||
makeTime(&tm); // return time_t from elements stored in tm struct
|
||||
```
|
||||
|
||||
The DS1307RTC library included in the download provides an example of how a time provider
|
||||
can use the low-level functions to interface with the Time library.
|
||||
321
源码/libraries/Time/Time.cpp
Normal file
@ -0,0 +1,321 @@
|
||||
/*
|
||||
time.c - low level time and date functions
|
||||
Copyright (c) Michael Margolis 2009-2014
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
1.0 6 Jan 2010 - initial release
|
||||
1.1 12 Feb 2010 - fixed leap year calculation error
|
||||
1.2 1 Nov 2010 - fixed setTime bug (thanks to Korman for this)
|
||||
1.3 24 Mar 2012 - many edits by Paul Stoffregen: fixed timeStatus() to update
|
||||
status, updated examples for Arduino 1.0, fixed ARM
|
||||
compatibility issues, added TimeArduinoDue and TimeTeensy3
|
||||
examples, add error checking and messages to RTC examples,
|
||||
add examples to DS1307RTC library.
|
||||
1.4 5 Sep 2014 - compatibility with Arduino 1.5.7
|
||||
*/
|
||||
|
||||
#if ARDUINO >= 100
|
||||
#include <Arduino.h>
|
||||
#else
|
||||
#include <WProgram.h>
|
||||
#endif
|
||||
|
||||
#include "TimeLib.h"
|
||||
|
||||
static tmElements_t tm; // a cache of time elements
|
||||
static time_t cacheTime; // the time the cache was updated
|
||||
static uint32_t syncInterval = 300; // time sync will be attempted after this many seconds
|
||||
|
||||
void refreshCache(time_t t) {
|
||||
if (t != cacheTime) {
|
||||
breakTime(t, tm);
|
||||
cacheTime = t;
|
||||
}
|
||||
}
|
||||
|
||||
int hour() { // the hour now
|
||||
return hour(now());
|
||||
}
|
||||
|
||||
int hour(time_t t) { // the hour for the given time
|
||||
refreshCache(t);
|
||||
return tm.Hour;
|
||||
}
|
||||
|
||||
int hourFormat12() { // the hour now in 12 hour format
|
||||
return hourFormat12(now());
|
||||
}
|
||||
|
||||
int hourFormat12(time_t t) { // the hour for the given time in 12 hour format
|
||||
refreshCache(t);
|
||||
if( tm.Hour == 0 )
|
||||
return 12; // 12 midnight
|
||||
else if( tm.Hour > 12)
|
||||
return tm.Hour - 12 ;
|
||||
else
|
||||
return tm.Hour ;
|
||||
}
|
||||
|
||||
uint8_t isAM() { // returns true if time now is AM
|
||||
return !isPM(now());
|
||||
}
|
||||
|
||||
uint8_t isAM(time_t t) { // returns true if given time is AM
|
||||
return !isPM(t);
|
||||
}
|
||||
|
||||
uint8_t isPM() { // returns true if PM
|
||||
return isPM(now());
|
||||
}
|
||||
|
||||
uint8_t isPM(time_t t) { // returns true if PM
|
||||
return (hour(t) >= 12);
|
||||
}
|
||||
|
||||
int minute() {
|
||||
return minute(now());
|
||||
}
|
||||
|
||||
int minute(time_t t) { // the minute for the given time
|
||||
refreshCache(t);
|
||||
return tm.Minute;
|
||||
}
|
||||
|
||||
int second() {
|
||||
return second(now());
|
||||
}
|
||||
|
||||
int second(time_t t) { // the second for the given time
|
||||
refreshCache(t);
|
||||
return tm.Second;
|
||||
}
|
||||
|
||||
int day(){
|
||||
return(day(now()));
|
||||
}
|
||||
|
||||
int day(time_t t) { // the day for the given time (0-6)
|
||||
refreshCache(t);
|
||||
return tm.Day;
|
||||
}
|
||||
|
||||
int weekday() { // Sunday is day 1
|
||||
return weekday(now());
|
||||
}
|
||||
|
||||
int weekday(time_t t) {
|
||||
refreshCache(t);
|
||||
return tm.Wday;
|
||||
}
|
||||
|
||||
int month(){
|
||||
return month(now());
|
||||
}
|
||||
|
||||
int month(time_t t) { // the month for the given time
|
||||
refreshCache(t);
|
||||
return tm.Month;
|
||||
}
|
||||
|
||||
int year() { // as in Processing, the full four digit year: (2009, 2010 etc)
|
||||
return year(now());
|
||||
}
|
||||
|
||||
int year(time_t t) { // the year for the given time
|
||||
refreshCache(t);
|
||||
return tmYearToCalendar(tm.Year);
|
||||
}
|
||||
|
||||
/*============================================================================*/
|
||||
/* functions to convert to and from system time */
|
||||
/* These are for interfacing with time serivces and are not normally needed in a sketch */
|
||||
|
||||
// leap year calulator expects year argument as years offset from 1970
|
||||
#define LEAP_YEAR(Y) ( ((1970+(Y))>0) && !((1970+(Y))%4) && ( ((1970+(Y))%100) || !((1970+(Y))%400) ) )
|
||||
|
||||
static const uint8_t monthDays[]={31,28,31,30,31,30,31,31,30,31,30,31}; // API starts months from 1, this array starts from 0
|
||||
|
||||
void breakTime(time_t timeInput, tmElements_t &tm){
|
||||
// break the given time_t into time components
|
||||
// this is a more compact version of the C library localtime function
|
||||
// note that year is offset from 1970 !!!
|
||||
|
||||
uint8_t year;
|
||||
uint8_t month, monthLength;
|
||||
uint32_t time;
|
||||
unsigned long days;
|
||||
|
||||
time = (uint32_t)timeInput;
|
||||
tm.Second = time % 60;
|
||||
time /= 60; // now it is minutes
|
||||
tm.Minute = time % 60;
|
||||
time /= 60; // now it is hours
|
||||
tm.Hour = time % 24;
|
||||
time /= 24; // now it is days
|
||||
tm.Wday = ((time + 4) % 7) + 1; // Sunday is day 1
|
||||
|
||||
year = 0;
|
||||
days = 0;
|
||||
while((unsigned)(days += (LEAP_YEAR(year) ? 366 : 365)) <= time) {
|
||||
year++;
|
||||
}
|
||||
tm.Year = year; // year is offset from 1970
|
||||
|
||||
days -= LEAP_YEAR(year) ? 366 : 365;
|
||||
time -= days; // now it is days in this year, starting at 0
|
||||
|
||||
days=0;
|
||||
month=0;
|
||||
monthLength=0;
|
||||
for (month=0; month<12; month++) {
|
||||
if (month==1) { // february
|
||||
if (LEAP_YEAR(year)) {
|
||||
monthLength=29;
|
||||
} else {
|
||||
monthLength=28;
|
||||
}
|
||||
} else {
|
||||
monthLength = monthDays[month];
|
||||
}
|
||||
|
||||
if (time >= monthLength) {
|
||||
time -= monthLength;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
tm.Month = month + 1; // jan is month 1
|
||||
tm.Day = time + 1; // day of month
|
||||
}
|
||||
|
||||
time_t makeTime(const tmElements_t &tm){
|
||||
// assemble time elements into time_t
|
||||
// note year argument is offset from 1970 (see macros in time.h to convert to other formats)
|
||||
// previous version used full four digit year (or digits since 2000),i.e. 2009 was 2009 or 9
|
||||
|
||||
int i;
|
||||
uint32_t seconds;
|
||||
|
||||
// seconds from 1970 till 1 jan 00:00:00 of the given year
|
||||
seconds= tm.Year*(SECS_PER_DAY * 365);
|
||||
for (i = 0; i < tm.Year; i++) {
|
||||
if (LEAP_YEAR(i)) {
|
||||
seconds += SECS_PER_DAY; // add extra days for leap years
|
||||
}
|
||||
}
|
||||
|
||||
// add days for this year, months start from 1
|
||||
for (i = 1; i < tm.Month; i++) {
|
||||
if ( (i == 2) && LEAP_YEAR(tm.Year)) {
|
||||
seconds += SECS_PER_DAY * 29;
|
||||
} else {
|
||||
seconds += SECS_PER_DAY * monthDays[i-1]; //monthDay array starts from 0
|
||||
}
|
||||
}
|
||||
seconds+= (tm.Day-1) * SECS_PER_DAY;
|
||||
seconds+= tm.Hour * SECS_PER_HOUR;
|
||||
seconds+= tm.Minute * SECS_PER_MIN;
|
||||
seconds+= tm.Second;
|
||||
return (time_t)seconds;
|
||||
}
|
||||
/*=====================================================*/
|
||||
/* Low level system time functions */
|
||||
|
||||
static uint32_t sysTime = 0;
|
||||
static uint32_t prevMillis = 0;
|
||||
static uint32_t nextSyncTime = 0;
|
||||
static timeStatus_t Status = timeNotSet;
|
||||
|
||||
getExternalTime getTimePtr; // pointer to external sync function
|
||||
//setExternalTime setTimePtr; // not used in this version
|
||||
|
||||
#ifdef TIME_DRIFT_INFO // define this to get drift data
|
||||
time_t sysUnsyncedTime = 0; // the time sysTime unadjusted by sync
|
||||
#endif
|
||||
|
||||
|
||||
time_t now() {
|
||||
// calculate number of seconds passed since last call to now()
|
||||
while (millis() - prevMillis >= 1000) {
|
||||
// millis() and prevMillis are both unsigned ints thus the subtraction will always be the absolute value of the difference
|
||||
sysTime++;
|
||||
prevMillis += 1000;
|
||||
#ifdef TIME_DRIFT_INFO
|
||||
sysUnsyncedTime++; // this can be compared to the synced time to measure long term drift
|
||||
#endif
|
||||
}
|
||||
if (nextSyncTime <= sysTime) {
|
||||
if (getTimePtr != 0) {
|
||||
time_t t = getTimePtr();
|
||||
if (t != 0) {
|
||||
setTime(t);
|
||||
} else {
|
||||
nextSyncTime = sysTime + syncInterval;
|
||||
Status = (Status == timeNotSet) ? timeNotSet : timeNeedsSync;
|
||||
}
|
||||
}
|
||||
}
|
||||
return (time_t)sysTime;
|
||||
}
|
||||
|
||||
void setTime(time_t t) {
|
||||
#ifdef TIME_DRIFT_INFO
|
||||
if(sysUnsyncedTime == 0)
|
||||
sysUnsyncedTime = t; // store the time of the first call to set a valid Time
|
||||
#endif
|
||||
|
||||
sysTime = (uint32_t)t;
|
||||
nextSyncTime = (uint32_t)t + syncInterval;
|
||||
Status = timeSet;
|
||||
prevMillis = millis(); // restart counting from now (thanks to Korman for this fix)
|
||||
}
|
||||
|
||||
void setTime(int hr,int min,int sec,int dy, int mnth, int yr){
|
||||
// year can be given as full four digit year or two digts (2010 or 10 for 2010);
|
||||
//it is converted to years since 1970
|
||||
if( yr > 99)
|
||||
yr = yr - 1970;
|
||||
else
|
||||
yr += 30;
|
||||
tm.Year = yr;
|
||||
tm.Month = mnth;
|
||||
tm.Day = dy;
|
||||
tm.Hour = hr;
|
||||
tm.Minute = min;
|
||||
tm.Second = sec;
|
||||
setTime(makeTime(tm));
|
||||
}
|
||||
|
||||
void adjustTime(long adjustment) {
|
||||
sysTime += adjustment;
|
||||
}
|
||||
|
||||
// indicates if time has been set and recently synchronized
|
||||
timeStatus_t timeStatus() {
|
||||
now(); // required to actually update the status
|
||||
return Status;
|
||||
}
|
||||
|
||||
void setSyncProvider( getExternalTime getTimeFunction){
|
||||
getTimePtr = getTimeFunction;
|
||||
nextSyncTime = sysTime;
|
||||
now(); // this will sync the clock
|
||||
}
|
||||
|
||||
void setSyncInterval(time_t interval){ // set the number of seconds between re-sync
|
||||
syncInterval = (uint32_t)interval;
|
||||
nextSyncTime = sysTime + syncInterval;
|
||||
}
|
||||
1
源码/libraries/Time/Time.h
Normal file
@ -0,0 +1 @@
|
||||
#include "TimeLib.h"
|
||||
144
源码/libraries/Time/TimeLib.h
Normal file
@ -0,0 +1,144 @@
|
||||
/*
|
||||
time.h - low level time and date functions
|
||||
*/
|
||||
|
||||
/*
|
||||
July 3 2011 - fixed elapsedSecsThisWeek macro (thanks Vincent Valdy for this)
|
||||
- fixed daysToTime_t macro (thanks maniacbug)
|
||||
*/
|
||||
|
||||
#ifndef _Time_h
|
||||
#ifdef __cplusplus
|
||||
#define _Time_h
|
||||
|
||||
#include <inttypes.h>
|
||||
#ifndef __AVR__
|
||||
#include <sys/types.h> // for __time_t_defined, but avr libc lacks sys/types.h
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(__time_t_defined) // avoid conflict with newlib or other posix libc
|
||||
typedef unsigned long time_t;
|
||||
#endif
|
||||
|
||||
|
||||
// This ugly hack allows us to define C++ overloaded functions, when included
|
||||
// from within an extern "C", as newlib's sys/stat.h does. Actually it is
|
||||
// intended to include "time.h" from the C library (on ARM, but AVR does not
|
||||
// have that file at all). On Mac and Windows, the compiler will find this
|
||||
// "Time.h" instead of the C library "time.h", so we may cause other weird
|
||||
// and unpredictable effects by conflicting with the C library header "time.h",
|
||||
// but at least this hack lets us define C++ functions as intended. Hopefully
|
||||
// nothing too terrible will result from overriding the C library header?!
|
||||
extern "C++" {
|
||||
typedef enum {timeNotSet, timeNeedsSync, timeSet
|
||||
} timeStatus_t ;
|
||||
|
||||
typedef enum {
|
||||
dowInvalid, dowSunday, dowMonday, dowTuesday, dowWednesday, dowThursday, dowFriday, dowSaturday
|
||||
} timeDayOfWeek_t;
|
||||
|
||||
typedef enum {
|
||||
tmSecond, tmMinute, tmHour, tmWday, tmDay,tmMonth, tmYear, tmNbrFields
|
||||
} tmByteFields;
|
||||
|
||||
typedef struct {
|
||||
uint8_t Second;
|
||||
uint8_t Minute;
|
||||
uint8_t Hour;
|
||||
uint8_t Wday; // day of week, sunday is day 1
|
||||
uint8_t Day;
|
||||
uint8_t Month;
|
||||
uint8_t Year; // offset from 1970;
|
||||
} tmElements_t, TimeElements, *tmElementsPtr_t;
|
||||
|
||||
//convenience macros to convert to and from tm years
|
||||
#define tmYearToCalendar(Y) ((Y) + 1970) // full four digit year
|
||||
#define CalendarYrToTm(Y) ((Y) - 1970)
|
||||
#define tmYearToY2k(Y) ((Y) - 30) // offset is from 2000
|
||||
#define y2kYearToTm(Y) ((Y) + 30)
|
||||
|
||||
typedef time_t(*getExternalTime)();
|
||||
//typedef void (*setExternalTime)(const time_t); // not used in this version
|
||||
|
||||
|
||||
/*==============================================================================*/
|
||||
/* Useful Constants */
|
||||
#define SECS_PER_MIN ((time_t)(60UL))
|
||||
#define SECS_PER_HOUR ((time_t)(3600UL))
|
||||
#define SECS_PER_DAY ((time_t)(SECS_PER_HOUR * 24UL))
|
||||
#define DAYS_PER_WEEK ((time_t)(7UL))
|
||||
#define SECS_PER_WEEK ((time_t)(SECS_PER_DAY * DAYS_PER_WEEK))
|
||||
#define SECS_PER_YEAR ((time_t)(SECS_PER_DAY * 365UL)) // TODO: ought to handle leap years
|
||||
#define SECS_YR_2000 ((time_t)(946684800UL)) // the time at the start of y2k
|
||||
|
||||
/* Useful Macros for getting elapsed time */
|
||||
#define numberOfSeconds(_time_) ((_time_) % SECS_PER_MIN)
|
||||
#define numberOfMinutes(_time_) (((_time_) / SECS_PER_MIN) % SECS_PER_MIN)
|
||||
#define numberOfHours(_time_) (((_time_) % SECS_PER_DAY) / SECS_PER_HOUR)
|
||||
#define dayOfWeek(_time_) ((((_time_) / SECS_PER_DAY + 4) % DAYS_PER_WEEK)+1) // 1 = Sunday
|
||||
#define elapsedDays(_time_) ((_time_) / SECS_PER_DAY) // this is number of days since Jan 1 1970
|
||||
#define elapsedSecsToday(_time_) ((_time_) % SECS_PER_DAY) // the number of seconds since last midnight
|
||||
// The following macros are used in calculating alarms and assume the clock is set to a date later than Jan 1 1971
|
||||
// Always set the correct time before settting alarms
|
||||
#define previousMidnight(_time_) (((_time_) / SECS_PER_DAY) * SECS_PER_DAY) // time at the start of the given day
|
||||
#define nextMidnight(_time_) (previousMidnight(_time_) + SECS_PER_DAY) // time at the end of the given day
|
||||
#define elapsedSecsThisWeek(_time_) (elapsedSecsToday(_time_) + ((dayOfWeek(_time_)-1) * SECS_PER_DAY)) // note that week starts on day 1
|
||||
#define previousSunday(_time_) ((_time_) - elapsedSecsThisWeek(_time_)) // time at the start of the week for the given time
|
||||
#define nextSunday(_time_) (previousSunday(_time_)+SECS_PER_WEEK) // time at the end of the week for the given time
|
||||
|
||||
|
||||
/* Useful Macros for converting elapsed time to a time_t */
|
||||
#define minutesToTime_t ((M)) ( (M) * SECS_PER_MIN)
|
||||
#define hoursToTime_t ((H)) ( (H) * SECS_PER_HOUR)
|
||||
#define daysToTime_t ((D)) ( (D) * SECS_PER_DAY) // fixed on Jul 22 2011
|
||||
#define weeksToTime_t ((W)) ( (W) * SECS_PER_WEEK)
|
||||
|
||||
/*============================================================================*/
|
||||
/* time and date functions */
|
||||
int hour(); // the hour now
|
||||
int hour(time_t t); // the hour for the given time
|
||||
int hourFormat12(); // the hour now in 12 hour format
|
||||
int hourFormat12(time_t t); // the hour for the given time in 12 hour format
|
||||
uint8_t isAM(); // returns true if time now is AM
|
||||
uint8_t isAM(time_t t); // returns true the given time is AM
|
||||
uint8_t isPM(); // returns true if time now is PM
|
||||
uint8_t isPM(time_t t); // returns true the given time is PM
|
||||
int minute(); // the minute now
|
||||
int minute(time_t t); // the minute for the given time
|
||||
int second(); // the second now
|
||||
int second(time_t t); // the second for the given time
|
||||
int day(); // the day now
|
||||
int day(time_t t); // the day for the given time
|
||||
int weekday(); // the weekday now (Sunday is day 1)
|
||||
int weekday(time_t t); // the weekday for the given time
|
||||
int month(); // the month now (Jan is month 1)
|
||||
int month(time_t t); // the month for the given time
|
||||
int year(); // the full four digit year: (2009, 2010 etc)
|
||||
int year(time_t t); // the year for the given time
|
||||
|
||||
time_t now(); // return the current time as seconds since Jan 1 1970
|
||||
void setTime(time_t t);
|
||||
void setTime(int hr,int min,int sec,int day, int month, int yr);
|
||||
void adjustTime(long adjustment);
|
||||
|
||||
/* date strings */
|
||||
#define dt_MAX_STRING_LEN 9 // length of longest date string (excluding terminating null)
|
||||
char* monthStr(uint8_t month);
|
||||
char* dayStr(uint8_t day);
|
||||
char* monthShortStr(uint8_t month);
|
||||
char* dayShortStr(uint8_t day);
|
||||
|
||||
/* time sync functions */
|
||||
timeStatus_t timeStatus(); // indicates if time has been set and recently synchronized
|
||||
void setSyncProvider( getExternalTime getTimeFunction); // identify the external time provider
|
||||
void setSyncInterval(time_t interval); // set the number of seconds between re-sync
|
||||
|
||||
/* low level functions to convert to and from system time */
|
||||
void breakTime(time_t time, tmElements_t &tm); // break time_t into elements
|
||||
time_t makeTime(const tmElements_t &tm); // convert time elements into time_t
|
||||
|
||||
} // extern "C++"
|
||||
#endif // __cplusplus
|
||||
#endif /* _Time_h */
|
||||
|
||||
64
源码/libraries/Time/docs/issue_template.md
Normal file
@ -0,0 +1,64 @@
|
||||
Please use this form only to report code defects or bugs.
|
||||
|
||||
For any question, even questions directly pertaining to this code, post your question on the forums related to the board you are using.
|
||||
|
||||
Arduino: forum.arduino.cc
|
||||
Teensy: forum.pjrc.com
|
||||
ESP8266: www.esp8266.com
|
||||
ESP32: www.esp32.com
|
||||
Adafruit Feather/Metro/Trinket: forums.adafruit.com
|
||||
Particle Photon: community.particle.io
|
||||
|
||||
If you are experiencing trouble but not certain of the cause, or need help using this code, ask on the appropriate forum. This is not the place to ask for support or help, even directly related to this code. Only use this form you are certain you have discovered a defect in this code!
|
||||
|
||||
Please verify the problem occurs when using the very latest version, using the newest version of Arduino and any other related software.
|
||||
|
||||
|
||||
----------------------------- Remove above -----------------------------
|
||||
|
||||
|
||||
|
||||
### Description
|
||||
|
||||
Describe your problem.
|
||||
|
||||
|
||||
|
||||
### Steps To Reproduce Problem
|
||||
|
||||
Please give detailed instructions needed for anyone to attempt to reproduce the problem.
|
||||
|
||||
|
||||
|
||||
### Hardware & Software
|
||||
|
||||
Board
|
||||
Shields / modules used
|
||||
Arduino IDE version
|
||||
Teensyduino version (if using Teensy)
|
||||
Version info & package name (from Tools > Boards > Board Manager)
|
||||
Operating system & version
|
||||
Any other software or hardware?
|
||||
|
||||
|
||||
### Arduino Sketch
|
||||
|
||||
```cpp
|
||||
// Change the code below by your sketch (please try to give the smallest code which demonstrates the problem)
|
||||
#include <Arduino.h>
|
||||
|
||||
// libraries: give links/details so anyone can compile your code for the same result
|
||||
|
||||
void setup() {
|
||||
}
|
||||
|
||||
void loop() {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Errors or Incorrect Output
|
||||
|
||||
If you see any errors or incorrect output, please show it here. Please use copy & paste to give an exact copy of the message. Details matter, so please show (not merely describe) the actual message or error exactly as it appears.
|
||||
|
||||
|
||||
@ -0,0 +1,78 @@
|
||||
/**
|
||||
* SyncArduinoClock.
|
||||
*
|
||||
* portIndex must be set to the port connected to the Arduino
|
||||
*
|
||||
* The current time is sent in response to request message from Arduino
|
||||
* or by clicking the display window
|
||||
*
|
||||
* The time message is 11 ASCII text characters; a header (the letter 'T')
|
||||
* followed by the ten digit system time (unix time)
|
||||
*/
|
||||
|
||||
|
||||
import processing.serial.*;
|
||||
import java.util.Date;
|
||||
import java.util.Calendar;
|
||||
import java.util.GregorianCalendar;
|
||||
|
||||
public static final short portIndex = 0; // select the com port, 0 is the first port
|
||||
public static final String TIME_HEADER = "T"; //header for arduino serial time message
|
||||
public static final char TIME_REQUEST = 7; // ASCII bell character
|
||||
public static final char LF = 10; // ASCII linefeed
|
||||
public static final char CR = 13; // ASCII linefeed
|
||||
Serial myPort; // Create object from Serial class
|
||||
|
||||
void setup() {
|
||||
size(200, 200);
|
||||
println(Serial.list());
|
||||
println(" Connecting to -> " + Serial.list()[portIndex]);
|
||||
myPort = new Serial(this,Serial.list()[portIndex], 9600);
|
||||
println(getTimeNow());
|
||||
}
|
||||
|
||||
void draw()
|
||||
{
|
||||
textSize(20);
|
||||
textAlign(CENTER);
|
||||
fill(0);
|
||||
text("Click to send\nTime Sync", 0, 75, 200, 175);
|
||||
if ( myPort.available() > 0) { // If data is available,
|
||||
char val = char(myPort.read()); // read it and store it in val
|
||||
if(val == TIME_REQUEST){
|
||||
long t = getTimeNow();
|
||||
sendTimeMessage(TIME_HEADER, t);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(val == LF)
|
||||
; //igonore
|
||||
else if(val == CR)
|
||||
println();
|
||||
else
|
||||
print(val); // echo everying but time request
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void mousePressed() {
|
||||
sendTimeMessage( TIME_HEADER, getTimeNow());
|
||||
}
|
||||
|
||||
|
||||
void sendTimeMessage(String header, long time) {
|
||||
String timeStr = String.valueOf(time);
|
||||
myPort.write(header); // send header and time to arduino
|
||||
myPort.write(timeStr);
|
||||
myPort.write('\n');
|
||||
}
|
||||
|
||||
long getTimeNow(){
|
||||
// java time is in ms, we want secs
|
||||
Date d = new Date();
|
||||
Calendar cal = new GregorianCalendar();
|
||||
long current = d.getTime()/1000;
|
||||
long timezone = cal.get(cal.ZONE_OFFSET)/1000;
|
||||
long daylight = cal.get(cal.DST_OFFSET)/1000;
|
||||
return current + timezone + daylight;
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
SyncArduinoClock is a Processing sketch that responds to Arduino requests for
|
||||
time synchronization messages.
|
||||
|
||||
The portIndex must be set the Serial port connected to Arduino.
|
||||
|
||||
Download TimeSerial.pde onto Arduino and you should see the time
|
||||
message displayed when you run SyncArduinoClock in Processing.
|
||||
The Arduino time is set from the time on your computer through the
|
||||
Processing sketch.
|
||||
71
源码/libraries/Time/examples/TimeArduinoDue/TimeArduinoDue.ino
Normal file
@ -0,0 +1,71 @@
|
||||
/*
|
||||
* TimeRTC.pde
|
||||
* example code illustrating Time library with Real Time Clock.
|
||||
*
|
||||
* This example requires Markus Lange's Arduino Due RTC Library
|
||||
* https://github.com/MarkusLange/Arduino-Due-RTC-Library
|
||||
*/
|
||||
|
||||
#include <TimeLib.h>
|
||||
#include <rtc_clock.h>
|
||||
|
||||
// Select the Slowclock source
|
||||
//RTC_clock rtc_clock(RC);
|
||||
RTC_clock rtc_clock(XTAL);
|
||||
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
rtc_clock.init();
|
||||
if (rtc_clock.date_already_set() == 0) {
|
||||
// Unfortunately, the Arduino Due hardware does not seem to
|
||||
// be designed to maintain the RTC clock state when the
|
||||
// board resets. Markus described it thusly: "Uhh the Due
|
||||
// does reset with the NRSTB pin. This resets the full chip
|
||||
// with all backup regions including RTC, RTT and SC. Only
|
||||
// if the reset is done with the NRST pin will these regions
|
||||
// stay with their old values."
|
||||
rtc_clock.set_time(__TIME__);
|
||||
rtc_clock.set_date(__DATE__);
|
||||
// However, this might work on other unofficial SAM3X boards
|
||||
// with different reset circuitry than Arduino Due?
|
||||
}
|
||||
setSyncProvider(getArduinoDueTime);
|
||||
if(timeStatus()!= timeSet)
|
||||
Serial.println("Unable to sync with the RTC");
|
||||
else
|
||||
Serial.println("RTC has set the system time");
|
||||
}
|
||||
|
||||
time_t getArduinoDueTime()
|
||||
{
|
||||
return rtc_clock.unixtime();
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
digitalClockDisplay();
|
||||
delay(1000);
|
||||
}
|
||||
|
||||
void digitalClockDisplay(){
|
||||
// digital clock display of the time
|
||||
Serial.print(hour());
|
||||
printDigits(minute());
|
||||
printDigits(second());
|
||||
Serial.print(" ");
|
||||
Serial.print(day());
|
||||
Serial.print(" ");
|
||||
Serial.print(month());
|
||||
Serial.print(" ");
|
||||
Serial.print(year());
|
||||
Serial.println();
|
||||
}
|
||||
|
||||
void printDigits(int digits){
|
||||
// utility function for digital clock display: prints preceding colon and leading 0
|
||||
Serial.print(":");
|
||||
if(digits < 10)
|
||||
Serial.print('0');
|
||||
Serial.print(digits);
|
||||
}
|
||||
|
||||
87
源码/libraries/Time/examples/TimeGPS/TimeGPS.ino
Normal file
@ -0,0 +1,87 @@
|
||||
/*
|
||||
* TimeGPS.pde
|
||||
* example code illustrating time synced from a GPS
|
||||
*
|
||||
*/
|
||||
|
||||
#include <TimeLib.h>
|
||||
#include <TinyGPS.h> // http://arduiniana.org/libraries/TinyGPS/
|
||||
#include <SoftwareSerial.h>
|
||||
// TinyGPS and SoftwareSerial libraries are the work of Mikal Hart
|
||||
|
||||
SoftwareSerial SerialGPS = SoftwareSerial(10, 11); // receive on pin 10
|
||||
TinyGPS gps;
|
||||
|
||||
// To use a hardware serial port, which is far more efficient than
|
||||
// SoftwareSerial, uncomment this line and remove SoftwareSerial
|
||||
//#define SerialGPS Serial1
|
||||
|
||||
// Offset hours from gps time (UTC)
|
||||
const int offset = 1; // Central European Time
|
||||
//const int offset = -5; // Eastern Standard Time (USA)
|
||||
//const int offset = -4; // Eastern Daylight Time (USA)
|
||||
//const int offset = -8; // Pacific Standard Time (USA)
|
||||
//const int offset = -7; // Pacific Daylight Time (USA)
|
||||
|
||||
// Ideally, it should be possible to learn the time zone
|
||||
// based on the GPS position data. However, that would
|
||||
// require a complex library, probably incorporating some
|
||||
// sort of database using Eric Muller's time zone shape
|
||||
// maps, at http://efele.net/maps/tz/
|
||||
|
||||
time_t prevDisplay = 0; // when the digital clock was displayed
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(9600);
|
||||
while (!Serial) ; // Needed for Leonardo only
|
||||
SerialGPS.begin(4800);
|
||||
Serial.println("Waiting for GPS time ... ");
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
while (SerialGPS.available()) {
|
||||
if (gps.encode(SerialGPS.read())) { // process gps messages
|
||||
// when TinyGPS reports new data...
|
||||
unsigned long age;
|
||||
int Year;
|
||||
byte Month, Day, Hour, Minute, Second;
|
||||
gps.crack_datetime(&Year, &Month, &Day, &Hour, &Minute, &Second, NULL, &age);
|
||||
if (age < 500) {
|
||||
// set the Time to the latest GPS reading
|
||||
setTime(Hour, Minute, Second, Day, Month, Year);
|
||||
adjustTime(offset * SECS_PER_HOUR);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (timeStatus()!= timeNotSet) {
|
||||
if (now() != prevDisplay) { //update the display only if the time has changed
|
||||
prevDisplay = now();
|
||||
digitalClockDisplay();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void digitalClockDisplay(){
|
||||
// digital clock display of the time
|
||||
Serial.print(hour());
|
||||
printDigits(minute());
|
||||
printDigits(second());
|
||||
Serial.print(" ");
|
||||
Serial.print(day());
|
||||
Serial.print(" ");
|
||||
Serial.print(month());
|
||||
Serial.print(" ");
|
||||
Serial.print(year());
|
||||
Serial.println();
|
||||
}
|
||||
|
||||
void printDigits(int digits) {
|
||||
// utility function for digital clock display: prints preceding colon and leading 0
|
||||
Serial.print(":");
|
||||
if(digits < 10)
|
||||
Serial.print('0');
|
||||
Serial.print(digits);
|
||||
}
|
||||
|
||||
135
源码/libraries/Time/examples/TimeNTP/TimeNTP.ino
Normal file
@ -0,0 +1,135 @@
|
||||
/*
|
||||
* Time_NTP.pde
|
||||
* Example showing time sync to NTP time source
|
||||
*
|
||||
* This sketch uses the Ethernet library
|
||||
*/
|
||||
|
||||
#include <TimeLib.h>
|
||||
#include <Ethernet.h>
|
||||
#include <EthernetUdp.h>
|
||||
#include <SPI.h>
|
||||
|
||||
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
|
||||
// NTP Servers:
|
||||
IPAddress timeServer(132, 163, 4, 101); // time-a.timefreq.bldrdoc.gov
|
||||
// IPAddress timeServer(132, 163, 4, 102); // time-b.timefreq.bldrdoc.gov
|
||||
// IPAddress timeServer(132, 163, 4, 103); // time-c.timefreq.bldrdoc.gov
|
||||
|
||||
|
||||
const int timeZone = 1; // Central European Time
|
||||
//const int timeZone = -5; // Eastern Standard Time (USA)
|
||||
//const int timeZone = -4; // Eastern Daylight Time (USA)
|
||||
//const int timeZone = -8; // Pacific Standard Time (USA)
|
||||
//const int timeZone = -7; // Pacific Daylight Time (USA)
|
||||
|
||||
|
||||
EthernetUDP Udp;
|
||||
unsigned int localPort = 8888; // local port to listen for UDP packets
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(9600);
|
||||
while (!Serial) ; // Needed for Leonardo only
|
||||
delay(250);
|
||||
Serial.println("TimeNTP Example");
|
||||
if (Ethernet.begin(mac) == 0) {
|
||||
// no point in carrying on, so do nothing forevermore:
|
||||
while (1) {
|
||||
Serial.println("Failed to configure Ethernet using DHCP");
|
||||
delay(10000);
|
||||
}
|
||||
}
|
||||
Serial.print("IP number assigned by DHCP is ");
|
||||
Serial.println(Ethernet.localIP());
|
||||
Udp.begin(localPort);
|
||||
Serial.println("waiting for sync");
|
||||
setSyncProvider(getNtpTime);
|
||||
}
|
||||
|
||||
time_t prevDisplay = 0; // when the digital clock was displayed
|
||||
|
||||
void loop()
|
||||
{
|
||||
if (timeStatus() != timeNotSet) {
|
||||
if (now() != prevDisplay) { //update the display only if time has changed
|
||||
prevDisplay = now();
|
||||
digitalClockDisplay();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void digitalClockDisplay(){
|
||||
// digital clock display of the time
|
||||
Serial.print(hour());
|
||||
printDigits(minute());
|
||||
printDigits(second());
|
||||
Serial.print(" ");
|
||||
Serial.print(day());
|
||||
Serial.print(" ");
|
||||
Serial.print(month());
|
||||
Serial.print(" ");
|
||||
Serial.print(year());
|
||||
Serial.println();
|
||||
}
|
||||
|
||||
void printDigits(int digits){
|
||||
// utility for digital clock display: prints preceding colon and leading 0
|
||||
Serial.print(":");
|
||||
if(digits < 10)
|
||||
Serial.print('0');
|
||||
Serial.print(digits);
|
||||
}
|
||||
|
||||
/*-------- NTP code ----------*/
|
||||
|
||||
const int NTP_PACKET_SIZE = 48; // NTP time is in the first 48 bytes of message
|
||||
byte packetBuffer[NTP_PACKET_SIZE]; //buffer to hold incoming & outgoing packets
|
||||
|
||||
time_t getNtpTime()
|
||||
{
|
||||
while (Udp.parsePacket() > 0) ; // discard any previously received packets
|
||||
Serial.println("Transmit NTP Request");
|
||||
sendNTPpacket(timeServer);
|
||||
uint32_t beginWait = millis();
|
||||
while (millis() - beginWait < 1500) {
|
||||
int size = Udp.parsePacket();
|
||||
if (size >= NTP_PACKET_SIZE) {
|
||||
Serial.println("Receive NTP Response");
|
||||
Udp.read(packetBuffer, NTP_PACKET_SIZE); // read packet into the buffer
|
||||
unsigned long secsSince1900;
|
||||
// convert four bytes starting at location 40 to a long integer
|
||||
secsSince1900 = (unsigned long)packetBuffer[40] << 24;
|
||||
secsSince1900 |= (unsigned long)packetBuffer[41] << 16;
|
||||
secsSince1900 |= (unsigned long)packetBuffer[42] << 8;
|
||||
secsSince1900 |= (unsigned long)packetBuffer[43];
|
||||
return secsSince1900 - 2208988800UL + timeZone * SECS_PER_HOUR;
|
||||
}
|
||||
}
|
||||
Serial.println("No NTP Response :-(");
|
||||
return 0; // return 0 if unable to get the time
|
||||
}
|
||||
|
||||
// send an NTP request to the time server at the given address
|
||||
void sendNTPpacket(IPAddress &address)
|
||||
{
|
||||
// set all bytes in the buffer to 0
|
||||
memset(packetBuffer, 0, NTP_PACKET_SIZE);
|
||||
// Initialize values needed to form NTP request
|
||||
// (see URL above for details on the packets)
|
||||
packetBuffer[0] = 0b11100011; // LI, Version, Mode
|
||||
packetBuffer[1] = 0; // Stratum, or type of clock
|
||||
packetBuffer[2] = 6; // Polling Interval
|
||||
packetBuffer[3] = 0xEC; // Peer Clock Precision
|
||||
// 8 bytes of zero for Root Delay & Root Dispersion
|
||||
packetBuffer[12] = 49;
|
||||
packetBuffer[13] = 0x4E;
|
||||
packetBuffer[14] = 49;
|
||||
packetBuffer[15] = 52;
|
||||
// all NTP fields have been given values, now
|
||||
// you can send a packet requesting a timestamp:
|
||||
Udp.beginPacket(address, 123); //NTP requests are to port 123
|
||||
Udp.write(packetBuffer, NTP_PACKET_SIZE);
|
||||
Udp.endPacket();
|
||||
}
|
||||
|
||||
168
源码/libraries/Time/examples/TimeNTP_ENC28J60/TimeNTP_ENC28J60.ino
Normal file
@ -0,0 +1,168 @@
|
||||
/*
|
||||
* Time_NTP.pde
|
||||
* Example showing time sync to NTP time source
|
||||
*
|
||||
* Also shows how to handle DST automatically.
|
||||
*
|
||||
* This sketch uses the EtherCard library:
|
||||
* http://jeelabs.org/pub/docs/ethercard/
|
||||
*/
|
||||
|
||||
#include <TimeLib.h>
|
||||
#include <EtherCard.h>
|
||||
|
||||
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
|
||||
|
||||
// NTP Server
|
||||
const char timeServer[] PROGMEM = "pool.ntp.org";
|
||||
|
||||
const int utcOffset = 1; // Central European Time
|
||||
//const int utcOffset = -5; // Eastern Standard Time (USA)
|
||||
//const int utcOffset = -4; // Eastern Daylight Time (USA)
|
||||
//const int utcOffset = -8; // Pacific Standard Time (USA)
|
||||
//const int utcOffset = -7; // Pacific Daylight Time (USA)
|
||||
|
||||
// Packet buffer, must be big enough to packet and payload
|
||||
#define BUFFER_SIZE 550
|
||||
byte Ethernet::buffer[BUFFER_SIZE];
|
||||
|
||||
const unsigned int remotePort = 123;
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(9600);
|
||||
|
||||
while (!Serial) // Needed for Leonardo only
|
||||
;
|
||||
delay(250);
|
||||
|
||||
Serial.println("TimeNTP_ENC28J60 Example");
|
||||
|
||||
if (ether.begin(BUFFER_SIZE, mac) == 0) {
|
||||
// no point in carrying on, so do nothing forevermore:
|
||||
while (1) {
|
||||
Serial.println("Failed to access Ethernet controller");
|
||||
delay(10000);
|
||||
}
|
||||
}
|
||||
|
||||
if (!ether.dhcpSetup()) {
|
||||
// no point in carrying on, so do nothing forevermore:
|
||||
while (1) {
|
||||
Serial.println("Failed to configure Ethernet using DHCP");
|
||||
delay(10000);
|
||||
}
|
||||
}
|
||||
|
||||
ether.printIp("IP number assigned by DHCP is ", ether.myip);
|
||||
|
||||
Serial.println("waiting for sync");
|
||||
//setSyncProvider(getNtpTime); // Use this for GMT time
|
||||
setSyncProvider(getDstCorrectedTime); // Use this for local, DST-corrected time
|
||||
}
|
||||
|
||||
time_t prevDisplay = 0; // when the digital clock was displayed
|
||||
|
||||
void loop()
|
||||
{
|
||||
if (timeStatus() != timeNotSet) {
|
||||
if (now() != prevDisplay) { //update the display only if time has changed
|
||||
prevDisplay = now();
|
||||
digitalClockDisplay();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void digitalClockDisplay(){
|
||||
// digital clock display of the time
|
||||
Serial.print(hour());
|
||||
printDigits(minute());
|
||||
printDigits(second());
|
||||
Serial.print(" ");
|
||||
Serial.print(day());
|
||||
Serial.print(" ");
|
||||
Serial.print(month());
|
||||
Serial.print(" ");
|
||||
Serial.print(year());
|
||||
Serial.println();
|
||||
}
|
||||
|
||||
void printDigits(int digits){
|
||||
// utility for digital clock display: prints preceding colon and leading 0
|
||||
Serial.print(":");
|
||||
if(digits < 10)
|
||||
Serial.print('0');
|
||||
Serial.print(digits);
|
||||
}
|
||||
|
||||
/*-------- NTP code ----------*/
|
||||
|
||||
// SyncProvider that returns UTC time
|
||||
time_t getNtpTime()
|
||||
{
|
||||
// Send request
|
||||
Serial.println("Transmit NTP Request");
|
||||
if (!ether.dnsLookup(timeServer)) {
|
||||
Serial.println("DNS failed");
|
||||
return 0; // return 0 if unable to get the time
|
||||
} else {
|
||||
//ether.printIp("SRV: ", ether.hisip);
|
||||
ether.ntpRequest(ether.hisip, remotePort);
|
||||
|
||||
// Wait for reply
|
||||
uint32_t beginWait = millis();
|
||||
while (millis() - beginWait < 1500) {
|
||||
word len = ether.packetReceive();
|
||||
ether.packetLoop(len);
|
||||
|
||||
unsigned long secsSince1900 = 0L;
|
||||
if (len > 0 && ether.ntpProcessAnswer(&secsSince1900, remotePort)) {
|
||||
Serial.println("Receive NTP Response");
|
||||
return secsSince1900 - 2208988800UL;
|
||||
}
|
||||
}
|
||||
|
||||
Serial.println("No NTP Response :-(");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Alternative SyncProvider that automatically handles Daylight Saving Time (DST) periods,
|
||||
* at least in Europe, see below.
|
||||
*/
|
||||
time_t getDstCorrectedTime (void) {
|
||||
time_t t = getNtpTime ();
|
||||
|
||||
if (t > 0) {
|
||||
TimeElements tm;
|
||||
breakTime (t, tm);
|
||||
t += (utcOffset + dstOffset (tm.Day, tm.Month, tm.Year + 1970, tm.Hour)) * SECS_PER_HOUR;
|
||||
}
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
/* This function returns the DST offset for the current UTC time.
|
||||
* This is valid for the EU, for other places see
|
||||
* http://www.webexhibits.org/daylightsaving/i.html
|
||||
*
|
||||
* Results have been checked for 2012-2030 (but should work since
|
||||
* 1996 to 2099) against the following references:
|
||||
* - http://www.uniquevisitor.it/magazine/ora-legale-italia.php
|
||||
* - http://www.calendario-365.it/ora-legale-orario-invernale.html
|
||||
*/
|
||||
byte dstOffset (byte d, byte m, unsigned int y, byte h) {
|
||||
// Day in March that DST starts on, at 1 am
|
||||
byte dstOn = (31 - (5 * y / 4 + 4) % 7);
|
||||
|
||||
// Day in October that DST ends on, at 2 am
|
||||
byte dstOff = (31 - (5 * y / 4 + 1) % 7);
|
||||
|
||||
if ((m > 3 && m < 10) ||
|
||||
(m == 3 && (d > dstOn || (d == dstOn && h >= 1))) ||
|
||||
(m == 10 && (d < dstOff || (d == dstOff && h <= 1))))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -0,0 +1,156 @@
|
||||
/*
|
||||
* TimeNTP_ESP8266WiFi.ino
|
||||
* Example showing time sync to NTP time source
|
||||
*
|
||||
* This sketch uses the ESP8266WiFi library
|
||||
*/
|
||||
|
||||
#include <TimeLib.h>
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <WiFiUdp.h>
|
||||
|
||||
const char ssid[] = "*************"; // your network SSID (name)
|
||||
const char pass[] = "********"; // your network password
|
||||
|
||||
// NTP Servers:
|
||||
static const char ntpServerName[] = "us.pool.ntp.org";
|
||||
//static const char ntpServerName[] = "time.nist.gov";
|
||||
//static const char ntpServerName[] = "time-a.timefreq.bldrdoc.gov";
|
||||
//static const char ntpServerName[] = "time-b.timefreq.bldrdoc.gov";
|
||||
//static const char ntpServerName[] = "time-c.timefreq.bldrdoc.gov";
|
||||
|
||||
const int timeZone = 1; // Central European Time
|
||||
//const int timeZone = -5; // Eastern Standard Time (USA)
|
||||
//const int timeZone = -4; // Eastern Daylight Time (USA)
|
||||
//const int timeZone = -8; // Pacific Standard Time (USA)
|
||||
//const int timeZone = -7; // Pacific Daylight Time (USA)
|
||||
|
||||
|
||||
WiFiUDP Udp;
|
||||
unsigned int localPort = 8888; // local port to listen for UDP packets
|
||||
|
||||
time_t getNtpTime();
|
||||
void digitalClockDisplay();
|
||||
void printDigits(int digits);
|
||||
void sendNTPpacket(IPAddress &address);
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(9600);
|
||||
while (!Serial) ; // Needed for Leonardo only
|
||||
delay(250);
|
||||
Serial.println("TimeNTP Example");
|
||||
Serial.print("Connecting to ");
|
||||
Serial.println(ssid);
|
||||
WiFi.begin(ssid, pass);
|
||||
|
||||
while (WiFi.status() != WL_CONNECTED) {
|
||||
delay(500);
|
||||
Serial.print(".");
|
||||
}
|
||||
|
||||
Serial.print("IP number assigned by DHCP is ");
|
||||
Serial.println(WiFi.localIP());
|
||||
Serial.println("Starting UDP");
|
||||
Udp.begin(localPort);
|
||||
Serial.print("Local port: ");
|
||||
Serial.println(Udp.localPort());
|
||||
Serial.println("waiting for sync");
|
||||
setSyncProvider(getNtpTime);
|
||||
setSyncInterval(300);
|
||||
}
|
||||
|
||||
time_t prevDisplay = 0; // when the digital clock was displayed
|
||||
|
||||
void loop()
|
||||
{
|
||||
if (timeStatus() != timeNotSet) {
|
||||
if (now() != prevDisplay) { //update the display only if time has changed
|
||||
prevDisplay = now();
|
||||
digitalClockDisplay();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void digitalClockDisplay()
|
||||
{
|
||||
// digital clock display of the time
|
||||
Serial.print(hour());
|
||||
printDigits(minute());
|
||||
printDigits(second());
|
||||
Serial.print(" ");
|
||||
Serial.print(day());
|
||||
Serial.print(".");
|
||||
Serial.print(month());
|
||||
Serial.print(".");
|
||||
Serial.print(year());
|
||||
Serial.println();
|
||||
}
|
||||
|
||||
void printDigits(int digits)
|
||||
{
|
||||
// utility for digital clock display: prints preceding colon and leading 0
|
||||
Serial.print(":");
|
||||
if (digits < 10)
|
||||
Serial.print('0');
|
||||
Serial.print(digits);
|
||||
}
|
||||
|
||||
/*-------- NTP code ----------*/
|
||||
|
||||
const int NTP_PACKET_SIZE = 48; // NTP time is in the first 48 bytes of message
|
||||
byte packetBuffer[NTP_PACKET_SIZE]; //buffer to hold incoming & outgoing packets
|
||||
|
||||
time_t getNtpTime()
|
||||
{
|
||||
IPAddress ntpServerIP; // NTP server's ip address
|
||||
|
||||
while (Udp.parsePacket() > 0) ; // discard any previously received packets
|
||||
Serial.println("Transmit NTP Request");
|
||||
// get a random server from the pool
|
||||
WiFi.hostByName(ntpServerName, ntpServerIP);
|
||||
Serial.print(ntpServerName);
|
||||
Serial.print(": ");
|
||||
Serial.println(ntpServerIP);
|
||||
sendNTPpacket(ntpServerIP);
|
||||
uint32_t beginWait = millis();
|
||||
while (millis() - beginWait < 1500) {
|
||||
int size = Udp.parsePacket();
|
||||
if (size >= NTP_PACKET_SIZE) {
|
||||
Serial.println("Receive NTP Response");
|
||||
Udp.read(packetBuffer, NTP_PACKET_SIZE); // read packet into the buffer
|
||||
unsigned long secsSince1900;
|
||||
// convert four bytes starting at location 40 to a long integer
|
||||
secsSince1900 = (unsigned long)packetBuffer[40] << 24;
|
||||
secsSince1900 |= (unsigned long)packetBuffer[41] << 16;
|
||||
secsSince1900 |= (unsigned long)packetBuffer[42] << 8;
|
||||
secsSince1900 |= (unsigned long)packetBuffer[43];
|
||||
return secsSince1900 - 2208988800UL + timeZone * SECS_PER_HOUR;
|
||||
}
|
||||
}
|
||||
Serial.println("No NTP Response :-(");
|
||||
return 0; // return 0 if unable to get the time
|
||||
}
|
||||
|
||||
// send an NTP request to the time server at the given address
|
||||
void sendNTPpacket(IPAddress &address)
|
||||
{
|
||||
// set all bytes in the buffer to 0
|
||||
memset(packetBuffer, 0, NTP_PACKET_SIZE);
|
||||
// Initialize values needed to form NTP request
|
||||
// (see URL above for details on the packets)
|
||||
packetBuffer[0] = 0b11100011; // LI, Version, Mode
|
||||
packetBuffer[1] = 0; // Stratum, or type of clock
|
||||
packetBuffer[2] = 6; // Polling Interval
|
||||
packetBuffer[3] = 0xEC; // Peer Clock Precision
|
||||
// 8 bytes of zero for Root Delay & Root Dispersion
|
||||
packetBuffer[12] = 49;
|
||||
packetBuffer[13] = 0x4E;
|
||||
packetBuffer[14] = 49;
|
||||
packetBuffer[15] = 52;
|
||||
// all NTP fields have been given values, now
|
||||
// you can send a packet requesting a timestamp:
|
||||
Udp.beginPacket(address, 123); //NTP requests are to port 123
|
||||
Udp.write(packetBuffer, NTP_PACKET_SIZE);
|
||||
Udp.endPacket();
|
||||
}
|
||||
55
源码/libraries/Time/examples/TimeRTC/TimeRTC.ino
Normal file
@ -0,0 +1,55 @@
|
||||
/*
|
||||
* TimeRTC.pde
|
||||
* example code illustrating Time library with Real Time Clock.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <TimeLib.h>
|
||||
#include <Wire.h>
|
||||
#include <DS1307RTC.h> // a basic DS1307 library that returns time as a time_t
|
||||
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
while (!Serial) ; // wait until Arduino Serial Monitor opens
|
||||
setSyncProvider(RTC.get); // the function to get the time from the RTC
|
||||
if(timeStatus()!= timeSet)
|
||||
Serial.println("Unable to sync with the RTC");
|
||||
else
|
||||
Serial.println("RTC has set the system time");
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
if (timeStatus() == timeSet) {
|
||||
digitalClockDisplay();
|
||||
} else {
|
||||
Serial.println("The time has not been set. Please run the Time");
|
||||
Serial.println("TimeRTCSet example, or DS1307RTC SetTime example.");
|
||||
Serial.println();
|
||||
delay(4000);
|
||||
}
|
||||
delay(1000);
|
||||
}
|
||||
|
||||
void digitalClockDisplay(){
|
||||
// digital clock display of the time
|
||||
Serial.print(hour());
|
||||
printDigits(minute());
|
||||
printDigits(second());
|
||||
Serial.print(" ");
|
||||
Serial.print(day());
|
||||
Serial.print(" ");
|
||||
Serial.print(month());
|
||||
Serial.print(" ");
|
||||
Serial.print(year());
|
||||
Serial.println();
|
||||
}
|
||||
|
||||
void printDigits(int digits){
|
||||
// utility function for digital clock display: prints preceding colon and leading 0
|
||||
Serial.print(":");
|
||||
if(digits < 10)
|
||||
Serial.print('0');
|
||||
Serial.print(digits);
|
||||
}
|
||||
|
||||
109
源码/libraries/Time/examples/TimeRTCLog/TimeRTCLog.ino
Normal file
@ -0,0 +1,109 @@
|
||||
/*
|
||||
* TimeRTCLogger.ino
|
||||
* example code illustrating adding and subtracting Time.
|
||||
*
|
||||
* this sketch logs pin state change events
|
||||
* the time of the event and time since the previous event is calculated and sent to the serial port.
|
||||
*/
|
||||
|
||||
#include <TimeLib.h>
|
||||
#include <Wire.h>
|
||||
#include <DS1307RTC.h> // a basic DS1307 library that returns time as a time_t
|
||||
|
||||
const int nbrInputPins = 6; // monitor 6 digital pins
|
||||
const int inputPins[nbrInputPins] = {2,3,4,5,6,7}; // pins to monitor
|
||||
boolean state[nbrInputPins] ; // the state of the monitored pins
|
||||
time_t prevEventTime[nbrInputPins] ; // the time of the previous event
|
||||
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
setSyncProvider(RTC.get); // the function to sync the time from the RTC
|
||||
for (int i=0; i < nbrInputPins; i++) {
|
||||
pinMode( inputPins[i], INPUT);
|
||||
// uncomment these lines if pull-up resistors are wanted
|
||||
// pinMode( inputPins[i], INPUT_PULLUP);
|
||||
// state[i] = HIGH;
|
||||
}
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
for (int i=0; i < nbrInputPins; i++) {
|
||||
boolean val = digitalRead(inputPins[i]);
|
||||
if (val != state[i]) {
|
||||
time_t duration = 0; // the time since the previous event
|
||||
state[i] = val;
|
||||
time_t timeNow = now();
|
||||
if (prevEventTime[i] > 0) {
|
||||
// if this was not the first state change, calculate the time from the previous change
|
||||
duration = timeNow - prevEventTime[i];
|
||||
}
|
||||
logEvent(inputPins[i], val, timeNow, duration ); // log the event
|
||||
prevEventTime[i] = timeNow; // store the time for this event
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void logEvent( int pin, boolean state, time_t timeNow, time_t duration)
|
||||
{
|
||||
Serial.print("Pin ");
|
||||
Serial.print(pin);
|
||||
if (state == HIGH) {
|
||||
Serial.print(" went High at ");
|
||||
} else {
|
||||
Serial.print(" went Low at ");
|
||||
}
|
||||
showTime(timeNow);
|
||||
if (duration > 0) {
|
||||
// only display duration if greater than 0
|
||||
Serial.print(", Duration was ");
|
||||
showDuration(duration);
|
||||
}
|
||||
Serial.println();
|
||||
}
|
||||
|
||||
|
||||
void showTime(time_t t)
|
||||
{
|
||||
// display the given time
|
||||
Serial.print(hour(t));
|
||||
printDigits(minute(t));
|
||||
printDigits(second(t));
|
||||
Serial.print(" ");
|
||||
Serial.print(day(t));
|
||||
Serial.print(" ");
|
||||
Serial.print(month(t));
|
||||
Serial.print(" ");
|
||||
Serial.print(year(t));
|
||||
}
|
||||
|
||||
void printDigits(int digits){
|
||||
// utility function for digital clock display: prints preceding colon and leading 0
|
||||
Serial.print(":");
|
||||
if(digits < 10)
|
||||
Serial.print('0');
|
||||
Serial.print(digits);
|
||||
}
|
||||
|
||||
void showDuration(time_t duration)
|
||||
{
|
||||
// prints the duration in days, hours, minutes and seconds
|
||||
if (duration >= SECS_PER_DAY) {
|
||||
Serial.print(duration / SECS_PER_DAY);
|
||||
Serial.print(" day(s) ");
|
||||
duration = duration % SECS_PER_DAY;
|
||||
}
|
||||
if (duration >= SECS_PER_HOUR) {
|
||||
Serial.print(duration / SECS_PER_HOUR);
|
||||
Serial.print(" hour(s) ");
|
||||
duration = duration % SECS_PER_HOUR;
|
||||
}
|
||||
if (duration >= SECS_PER_MIN) {
|
||||
Serial.print(duration / SECS_PER_MIN);
|
||||
Serial.print(" minute(s) ");
|
||||
duration = duration % SECS_PER_MIN;
|
||||
}
|
||||
Serial.print(duration);
|
||||
Serial.print(" second(s) ");
|
||||
}
|
||||
|
||||
80
源码/libraries/Time/examples/TimeRTCSet/TimeRTCSet.ino
Normal file
@ -0,0 +1,80 @@
|
||||
/*
|
||||
* TimeRTCSet.pde
|
||||
* example code illustrating Time library with Real Time Clock.
|
||||
*
|
||||
* RTC clock is set in response to serial port time message
|
||||
* A Processing example sketch to set the time is included in the download
|
||||
* On Linux, you can use "date +T%s > /dev/ttyACM0" (UTC time zone)
|
||||
*/
|
||||
|
||||
#include <TimeLib.h>
|
||||
#include <Wire.h>
|
||||
#include <DS1307RTC.h> // a basic DS1307 library that returns time as a time_t
|
||||
|
||||
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
while (!Serial) ; // Needed for Leonardo only
|
||||
setSyncProvider(RTC.get); // the function to get the time from the RTC
|
||||
if (timeStatus() != timeSet)
|
||||
Serial.println("Unable to sync with the RTC");
|
||||
else
|
||||
Serial.println("RTC has set the system time");
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
if (Serial.available()) {
|
||||
time_t t = processSyncMessage();
|
||||
if (t != 0) {
|
||||
RTC.set(t); // set the RTC and the system time to the received value
|
||||
setTime(t);
|
||||
}
|
||||
}
|
||||
digitalClockDisplay();
|
||||
delay(1000);
|
||||
}
|
||||
|
||||
void digitalClockDisplay(){
|
||||
// digital clock display of the time
|
||||
Serial.print(hour());
|
||||
printDigits(minute());
|
||||
printDigits(second());
|
||||
Serial.print(" ");
|
||||
Serial.print(day());
|
||||
Serial.print(" ");
|
||||
Serial.print(month());
|
||||
Serial.print(" ");
|
||||
Serial.print(year());
|
||||
Serial.println();
|
||||
}
|
||||
|
||||
void printDigits(int digits){
|
||||
// utility function for digital clock display: prints preceding colon and leading 0
|
||||
Serial.print(":");
|
||||
if(digits < 10)
|
||||
Serial.print('0');
|
||||
Serial.print(digits);
|
||||
}
|
||||
|
||||
/* code to process time sync messages from the serial port */
|
||||
#define TIME_HEADER "T" // Header tag for serial time sync message
|
||||
|
||||
unsigned long processSyncMessage() {
|
||||
unsigned long pctime = 0L;
|
||||
const unsigned long DEFAULT_TIME = 1357041600; // Jan 1 2013
|
||||
|
||||
if(Serial.find(TIME_HEADER)) {
|
||||
pctime = Serial.parseInt();
|
||||
return pctime;
|
||||
if( pctime < DEFAULT_TIME) { // check the value is a valid time (greater than Jan 1 2013)
|
||||
pctime = 0L; // return 0 to indicate that the time is not valid
|
||||
}
|
||||
}
|
||||
return pctime;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
81
源码/libraries/Time/examples/TimeSerial/TimeSerial.ino
Normal file
@ -0,0 +1,81 @@
|
||||
/*
|
||||
* TimeSerial.pde
|
||||
* example code illustrating Time library set through serial port messages.
|
||||
*
|
||||
* Messages consist of the letter T followed by ten digit time (as seconds since Jan 1 1970)
|
||||
* you can send the text on the next line using Serial Monitor to set the clock to noon Jan 1 2013
|
||||
T1357041600
|
||||
*
|
||||
* A Processing example sketch to automatically send the messages is included in the download
|
||||
* On Linux, you can use "date +T%s\n > /dev/ttyACM0" (UTC time zone)
|
||||
*/
|
||||
|
||||
#include <TimeLib.h>
|
||||
|
||||
#define TIME_HEADER "T" // Header tag for serial time sync message
|
||||
#define TIME_REQUEST 7 // ASCII bell character requests a time sync message
|
||||
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
while (!Serial) ; // Needed for Leonardo only
|
||||
pinMode(13, OUTPUT);
|
||||
setSyncProvider( requestSync); //set function to call when sync required
|
||||
Serial.println("Waiting for sync message");
|
||||
}
|
||||
|
||||
void loop(){
|
||||
if (Serial.available()) {
|
||||
processSyncMessage();
|
||||
}
|
||||
if (timeStatus()!= timeNotSet) {
|
||||
digitalClockDisplay();
|
||||
}
|
||||
if (timeStatus() == timeSet) {
|
||||
digitalWrite(13, HIGH); // LED on if synced
|
||||
} else {
|
||||
digitalWrite(13, LOW); // LED off if needs refresh
|
||||
}
|
||||
delay(1000);
|
||||
}
|
||||
|
||||
void digitalClockDisplay(){
|
||||
// digital clock display of the time
|
||||
Serial.print(hour());
|
||||
printDigits(minute());
|
||||
printDigits(second());
|
||||
Serial.print(" ");
|
||||
Serial.print(day());
|
||||
Serial.print(" ");
|
||||
Serial.print(month());
|
||||
Serial.print(" ");
|
||||
Serial.print(year());
|
||||
Serial.println();
|
||||
}
|
||||
|
||||
void printDigits(int digits){
|
||||
// utility function for digital clock display: prints preceding colon and leading 0
|
||||
Serial.print(":");
|
||||
if(digits < 10)
|
||||
Serial.print('0');
|
||||
Serial.print(digits);
|
||||
}
|
||||
|
||||
|
||||
void processSyncMessage() {
|
||||
unsigned long pctime;
|
||||
const unsigned long DEFAULT_TIME = 1357041600; // Jan 1 2013
|
||||
|
||||
if(Serial.find(TIME_HEADER)) {
|
||||
pctime = Serial.parseInt();
|
||||
if( pctime >= DEFAULT_TIME) { // check the integer is a valid time (greater than Jan 1 2013)
|
||||
setTime(pctime); // Sync Arduino clock to the time received on the serial port
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
time_t requestSync()
|
||||
{
|
||||
Serial.write(TIME_REQUEST);
|
||||
return 0; // the time will be sent later in response to serial mesg
|
||||
}
|
||||
|
||||
@ -0,0 +1,108 @@
|
||||
/*
|
||||
* TimeSerialDateStrings.pde
|
||||
* example code illustrating Time library date strings
|
||||
*
|
||||
* This sketch adds date string functionality to TimeSerial sketch
|
||||
* Also shows how to handle different messages
|
||||
*
|
||||
* A message starting with a time header sets the time
|
||||
* A Processing example sketch to automatically send the messages is inclided in the download
|
||||
* On Linux, you can use "date +T%s\n > /dev/ttyACM0" (UTC time zone)
|
||||
*
|
||||
* A message starting with a format header sets the date format
|
||||
|
||||
* send: Fs\n for short date format
|
||||
* send: Fl\n for long date format
|
||||
*/
|
||||
|
||||
#include <TimeLib.h>
|
||||
|
||||
// single character message tags
|
||||
#define TIME_HEADER 'T' // Header tag for serial time sync message
|
||||
#define FORMAT_HEADER 'F' // Header tag indicating a date format message
|
||||
#define FORMAT_SHORT 's' // short month and day strings
|
||||
#define FORMAT_LONG 'l' // (lower case l) long month and day strings
|
||||
|
||||
#define TIME_REQUEST 7 // ASCII bell character requests a time sync message
|
||||
|
||||
static boolean isLongFormat = true;
|
||||
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
while (!Serial) ; // Needed for Leonardo only
|
||||
setSyncProvider( requestSync); //set function to call when sync required
|
||||
Serial.println("Waiting for sync message");
|
||||
}
|
||||
|
||||
void loop(){
|
||||
if (Serial.available() > 1) { // wait for at least two characters
|
||||
char c = Serial.read();
|
||||
if( c == TIME_HEADER) {
|
||||
processSyncMessage();
|
||||
}
|
||||
else if( c== FORMAT_HEADER) {
|
||||
processFormatMessage();
|
||||
}
|
||||
}
|
||||
if (timeStatus()!= timeNotSet) {
|
||||
digitalClockDisplay();
|
||||
}
|
||||
delay(1000);
|
||||
}
|
||||
|
||||
void digitalClockDisplay() {
|
||||
// digital clock display of the time
|
||||
Serial.print(hour());
|
||||
printDigits(minute());
|
||||
printDigits(second());
|
||||
Serial.print(" ");
|
||||
if(isLongFormat)
|
||||
Serial.print(dayStr(weekday()));
|
||||
else
|
||||
Serial.print(dayShortStr(weekday()));
|
||||
Serial.print(" ");
|
||||
Serial.print(day());
|
||||
Serial.print(" ");
|
||||
if(isLongFormat)
|
||||
Serial.print(monthStr(month()));
|
||||
else
|
||||
Serial.print(monthShortStr(month()));
|
||||
Serial.print(" ");
|
||||
Serial.print(year());
|
||||
Serial.println();
|
||||
}
|
||||
|
||||
void printDigits(int digits) {
|
||||
// utility function for digital clock display: prints preceding colon and leading 0
|
||||
Serial.print(":");
|
||||
if(digits < 10)
|
||||
Serial.print('0');
|
||||
Serial.print(digits);
|
||||
}
|
||||
|
||||
void processFormatMessage() {
|
||||
char c = Serial.read();
|
||||
if( c == FORMAT_LONG){
|
||||
isLongFormat = true;
|
||||
Serial.println(F("Setting long format"));
|
||||
}
|
||||
else if( c == FORMAT_SHORT) {
|
||||
isLongFormat = false;
|
||||
Serial.println(F("Setting short format"));
|
||||
}
|
||||
}
|
||||
|
||||
void processSyncMessage() {
|
||||
unsigned long pctime;
|
||||
const unsigned long DEFAULT_TIME = 1357041600; // Jan 1 2013 - paul, perhaps we define in time.h?
|
||||
|
||||
pctime = Serial.parseInt();
|
||||
if( pctime >= DEFAULT_TIME) { // check the integer is a valid time (greater than Jan 1 2013)
|
||||
setTime(pctime); // Sync Arduino clock to the time received on the serial port
|
||||
}
|
||||
}
|
||||
|
||||
time_t requestSync() {
|
||||
Serial.write(TIME_REQUEST);
|
||||
return 0; // the time will be sent later in response to serial mesg
|
||||
}
|
||||
78
源码/libraries/Time/examples/TimeTeensy3/TimeTeensy3.ino
Normal file
@ -0,0 +1,78 @@
|
||||
/*
|
||||
* TimeRTC.pde
|
||||
* example code illustrating Time library with Real Time Clock.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <TimeLib.h>
|
||||
|
||||
void setup() {
|
||||
// set the Time library to use Teensy 3.0's RTC to keep time
|
||||
setSyncProvider(getTeensy3Time);
|
||||
|
||||
Serial.begin(115200);
|
||||
while (!Serial); // Wait for Arduino Serial Monitor to open
|
||||
delay(100);
|
||||
if (timeStatus()!= timeSet) {
|
||||
Serial.println("Unable to sync with the RTC");
|
||||
} else {
|
||||
Serial.println("RTC has set the system time");
|
||||
}
|
||||
}
|
||||
|
||||
void loop() {
|
||||
if (Serial.available()) {
|
||||
time_t t = processSyncMessage();
|
||||
if (t != 0) {
|
||||
Teensy3Clock.set(t); // set the RTC
|
||||
setTime(t);
|
||||
}
|
||||
}
|
||||
digitalClockDisplay();
|
||||
delay(1000);
|
||||
}
|
||||
|
||||
void digitalClockDisplay() {
|
||||
// digital clock display of the time
|
||||
Serial.print(hour());
|
||||
printDigits(minute());
|
||||
printDigits(second());
|
||||
Serial.print(" ");
|
||||
Serial.print(day());
|
||||
Serial.print(" ");
|
||||
Serial.print(month());
|
||||
Serial.print(" ");
|
||||
Serial.print(year());
|
||||
Serial.println();
|
||||
}
|
||||
|
||||
time_t getTeensy3Time()
|
||||
{
|
||||
return Teensy3Clock.get();
|
||||
}
|
||||
|
||||
/* code to process time sync messages from the serial port */
|
||||
#define TIME_HEADER "T" // Header tag for serial time sync message
|
||||
|
||||
unsigned long processSyncMessage() {
|
||||
unsigned long pctime = 0L;
|
||||
const unsigned long DEFAULT_TIME = 1357041600; // Jan 1 2013
|
||||
|
||||
if(Serial.find(TIME_HEADER)) {
|
||||
pctime = Serial.parseInt();
|
||||
return pctime;
|
||||
if( pctime < DEFAULT_TIME) { // check the value is a valid time (greater than Jan 1 2013)
|
||||
pctime = 0L; // return 0 to indicate that the time is not valid
|
||||
}
|
||||
}
|
||||
return pctime;
|
||||
}
|
||||
|
||||
void printDigits(int digits){
|
||||
// utility function for digital clock display: prints preceding colon and leading 0
|
||||
Serial.print(":");
|
||||
if(digits < 10)
|
||||
Serial.print('0');
|
||||
Serial.print(digits);
|
||||
}
|
||||
|
||||
34
源码/libraries/Time/keywords.txt
Normal file
@ -0,0 +1,34 @@
|
||||
#######################################
|
||||
# Syntax Coloring Map For Time
|
||||
#######################################
|
||||
|
||||
#######################################
|
||||
# Datatypes (KEYWORD1)
|
||||
#######################################
|
||||
time_t KEYWORD1
|
||||
#######################################
|
||||
# Methods and Functions (KEYWORD2)
|
||||
#######################################
|
||||
now KEYWORD2
|
||||
second KEYWORD2
|
||||
minute KEYWORD2
|
||||
hour KEYWORD2
|
||||
day KEYWORD2
|
||||
month KEYWORD2
|
||||
year KEYWORD2
|
||||
isAM KEYWORD2
|
||||
isPM KEYWORD2
|
||||
weekday KEYWORD2
|
||||
setTime KEYWORD2
|
||||
adjustTime KEYWORD2
|
||||
setSyncProvider KEYWORD2
|
||||
setSyncInterval KEYWORD2
|
||||
timeStatus KEYWORD2
|
||||
TimeLib KEYWORD2
|
||||
#######################################
|
||||
# Instances (KEYWORD2)
|
||||
#######################################
|
||||
|
||||
#######################################
|
||||
# Constants (LITERAL1)
|
||||
#######################################
|
||||
26
源码/libraries/Time/library.json
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "Time",
|
||||
"description": "Time keeping library",
|
||||
"keywords": "Time, date, hour, minute, second, day, week, month, year, RTC",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Michael Margolis"
|
||||
},
|
||||
{
|
||||
"name": "Paul Stoffregen",
|
||||
"email": "paul@pjrc.com",
|
||||
"url": "http://www.pjrc.com",
|
||||
"maintainer": true
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PaulStoffregen/Time"
|
||||
},
|
||||
"version": "1.5",
|
||||
"homepage": "http://playground.arduino.cc/Code/Time",
|
||||
"frameworks": "Arduino",
|
||||
"examples": [
|
||||
"examples/*/*.ino"
|
||||
]
|
||||
}
|
||||
10
源码/libraries/Time/library.properties
Normal file
@ -0,0 +1,10 @@
|
||||
name=Time
|
||||
version=1.5
|
||||
author=Michael Margolis
|
||||
maintainer=Paul Stoffregen
|
||||
sentence=Timekeeping functionality for Arduino
|
||||
paragraph=Date and Time functions, with provisions to synchronize to external time sources like GPS and NTP (Internet). This library is often used together with TimeAlarms and DS1307RTC.
|
||||
category=Timing
|
||||
url=http://playground.arduino.cc/code/time
|
||||
architectures=*
|
||||
|
||||