第1篇:Arduino与ESP32开发板的安装方法
第2篇:ESP32 helloword第一个程序示范点亮板载LED
第3篇:vscode搭建esp32 arduino开发环境
第4篇:vscode+platformio搭建esp32 arduino开发环境
第5篇:doit_esp32_devkit_v1使用pmw呼吸灯实验
第6篇:ESP32连接无源喇叭播放音乐《涛声依旧》
第7篇:ESP32连接按钮点亮LED无源喇叭播放声音
第8篇:ESP32连接超声波HC-SR04测距点亮LED无源喇叭播放声音
第9篇:ESP32超声波HC-SR04Arduino类库编写
第10篇:ESP32外部中断功能的使用
第11篇:ESP32vscode_platformio_idf框架helloworld点亮LED
第12篇:ESP32模拟SPI驱动12864LCD_ST7920显示屏
接线方法参考第12篇:
第12篇:ESP32模拟SPI驱动12864LCD_ST7920显示屏
获取毫秒级时间 和普通系统函数相同
int get_sys_time_ms(void)
{
struct timeval tv_now;
gettimeofday(&tv_now, NULL);
int64_t time_us = (int64_t)tv_now.tv_sec * 1000000L + (int64_t)tv_now.tv_usec;
return (int)(time_us/1000);
}
2、延时毫秒级时间
void my_delay_ms(u32 time_ms)
{
vTaskDelay(time_ms / portTICK_RATE_MS);
}
SNTP校时
SNTP 指 简单网络时间协议(Simple Network Time Protocol),一个合格的物联网设备,少不了一个准确的钟。通过SNTP,可以使ESP32设备通过网络校准本地时间。
最简单+基础的方式
sntp_setoperatingmode(SNTP_OPMODE_POLL);
sntp_setservername(0, "ntp.aliyun.com");
sntp_init();
但此时,你的ESP32要联网,否则肯定是获取不了
接下来,你可以通过sntp_get_sync_status()轮询检测同步是否完毕,官方示例提供了这样的代码。除此之外。我们也可以通过回调来完成。更新成功之后,就随时可以获取系统时间了:
首先设置时区方法(这只影响下文时间转换,不影响时间同步。如果你有自己的方法,则可以通过自己的方式设置):
设置时区---时区缩写:
当sntp成功同步时间后,会有一个异步的回调通知应用做出相应更改
sntp_set_time_sync_notification_cb(/* 需要的函数指针 /);
初始化实例:
static void esp_initialize_sntp(void)
{ESP_LOGI("esp32idf_title", "Initializing SNTP");sntp_setoperatingmode(SNTP_OPMODE_POLL);sntp_setservername(0, "ntp1.aliyun.com");sntp_setservername(1, "cn.ntp.org.cn"); // 设置访问服务器sntp_setservername(2, "pool.ntp.org");sntp_setservername(3, "210.72.145.44"); // 国家授时中心服务器 IP 地址sntp_init();
}
连接WIFI:
/*** @description: 用于连接wifi的函数* @return {*}* @note: 这里wifi连接选项设置了使用nvs,会把每次配置的参数存储在nvs中。因此请查看分区表中是否对nvs分区进行了设置*/
void wifi_init_sta(void)
{// 00 创建wifi事件组s_wifi_event_group = xEventGroupCreate();/******************** 01 Wi-Fi/LwIP 初始化阶段 ********************/// 01-1 创建LWIP核心任务ESP_ERROR_CHECK(esp_netif_init());// 01-2 创建系统事件任务,并初始化应用程序事件的回调函数ESP_ERROR_CHECK(esp_event_loop_create_default());// 01-3 创建有 TCP/IP 堆栈的默认网络接口实例绑定 stationesp_netif_create_default_wifi_sta();// 01-4 创建wifi驱动程序任务,并初始化wifi驱动程序wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();ESP_ERROR_CHECK(esp_wifi_init(&cfg));// 01-5 注册,用于处理wifi连接的过程中的事件esp_event_handler_instance_t instance_any_id; // 用于处理wifi连接时候的事件的句柄esp_event_handler_instance_t instance_got_ip; // 用于处理ip分配时候产生的事件的句柄// 该句柄对wifi连接所有事件都产生响应,连接到event_handler回调函数ESP_ERROR_CHECK(esp_event_handler_instance_register(WIFI_EVENT,ESP_EVENT_ANY_ID,&event_handler,NULL,&instance_any_id));// 该句柄仅仅处理IP_EVENT事件组中的从AP中获取ip地址事件,连接到event_handler回调函数ESP_ERROR_CHECK(esp_event_handler_instance_register(IP_EVENT,IP_EVENT_STA_GOT_IP,&event_handler,NULL,&instance_got_ip));/******************** 02 WIFI配置阶段 ********************/wifi_config_t wifi_config = {.sta = {.ssid = EXAMPLE_ESP_WIFI_SSID,.password = EXAMPLE_ESP_WIFI_PASS,/* Setting a password implies station will connect to all security modes including WEP/WPA.* However these modes are deprecated and not advisable to be used. Incase your Access point* doesn't support WPA2, these mode can be enabled by commenting below line */.threshold.authmode = WIFI_AUTH_WPA2_PSK, // 设置快速扫描模式下能接受的最弱的验证模式.sae_pwe_h2e = WPA3_SAE_PWE_BOTH, // 设置SAE和PWE(wifi协议)的配置},};// 02-2 配置station工作模式ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA));// 02-3 配置ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wifi_config));/******************** 03 wifi启动阶段 ********************/// 03-1 启动wifi驱动程序ESP_ERROR_CHECK(esp_wifi_start()); // 会触发回调函数ESP_LOGI(TAG, "wifi_init_sta finished.");/* Waiting until either the connection is established (WIFI_CONNECTED_BIT) or connection failed for the maximum* number of re-tries (WIFI_FAIL_BIT). The bits are set by event_handler() (see above) *//******************** 输出wifi连接结果 ********************/EventBits_t bits = xEventGroupWaitBits(s_wifi_event_group,WIFI_CONNECTED_BIT | WIFI_FAIL_BIT,pdFALSE,pdFALSE,portMAX_DELAY);/* xEventGroupWaitBits() returns the bits before the call returned, hence we can test which event actually* happened. */if (bits & WIFI_CONNECTED_BIT){ESP_LOGI(TAG, "connected to ap SSID:%s password:%s",EXAMPLE_ESP_WIFI_SSID, EXAMPLE_ESP_WIFI_PASS);}else if (bits & WIFI_FAIL_BIT){ESP_LOGI(TAG, "Failed to connect to SSID:%s, password:%s",EXAMPLE_ESP_WIFI_SSID, EXAMPLE_ESP_WIFI_PASS);}else{ESP_LOGE(TAG, "UNEXPECTED EVENT");}/* The event will not be processed after unregister */// 05 事件注销ESP_ERROR_CHECK(esp_event_handler_instance_unregister(IP_EVENT, IP_EVENT_STA_GOT_IP, instance_got_ip));ESP_ERROR_CHECK(esp_event_handler_instance_unregister(WIFI_EVENT, ESP_EVENT_ANY_ID, instance_any_id));vEventGroupDelete(s_wifi_event_group);
}
main.c代码:
// 联网相关的宏
//#define EXAMPLE_ESP_WIFI_SSID "xx" // 账号
//#define EXAMPLE_ESP_WIFI_PASS "@xx68" // 密码
#define EXAMPLE_ESP_WIFI_SSID "xxx" // WIFI名字
#define EXAMPLE_ESP_WIFI_PASS "xx" // WIFI密码#define EXAMPLE_ESP_MAXIMUM_RETRY 5 // wifi连接失败以后可以重新连接的次数
#define WIFI_CONNECTED_BIT BIT0 // wifi连接成功标志位
#define WIFI_FAIL_BIT BIT1 // wifi连接失败标志位
#define AR_SIZE(a) sizeof(a) / sizeof(a[0])unsigned char show1[] = {0xB0, 0xA2, 0xCE, 0xE4, 0xBF, 0xC6, 0xBC, 0xBC}; //阿武科技unsigned char show_we_chat1[] = "wechat:txianwu";
unsigned char show_nick1[] = "txwtech";
unsigned char show_wifi_connecting[]="show_wifi_connecting...";
unsigned char show_wifi_reconnect[]="wifi_reconnecting...";
static const unsigned char logo0[] = { //笑脸0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF,0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF,0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xFE, 0x00,0x7F, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xF0, 0x00,0x0F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x80, 0x00,0x01, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00,0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00,0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x01, 0xF0, 0x00, 0x00,0x00, 0x0F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x03, 0xE0, 0x00, 0x00,0x00, 0x07, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x07, 0xC0, 0x00, 0x00,0x00, 0x01, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00,0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00,0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00,0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00,0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x40, 0x00,0x00, 0x80, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x78, 0x03, 0xF8, 0x00,0x07, 0xF0, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x70, 0x07, 0xFE, 0x00,0x0F, 0xFC, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0xF0, 0x1F, 0xBF, 0x00,0x3F, 0x7E, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0xE0, 0x3E, 0x0F, 0x80,0x7C, 0x1F, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0xE0, 0x7C, 0x07, 0xC0,0xF8, 0x0F, 0x87, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x01, 0xE0, 0xF8, 0x01, 0xE1,0xF0, 0x03, 0xC3, 0x80, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x01, 0xC0, 0xF0, 0x01, 0xE1,0xE0, 0x03, 0xC3, 0x80, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x01, 0xC0, 0xE0, 0x00, 0xE1,0xC0, 0x01, 0xC3, 0x80, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x01, 0xC0, 0x00, 0x00, 0x00,0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00,0x00, 0x00, 0x01, 0xC0, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00,0x00, 0x00, 0x01, 0xC0, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00,0x00, 0x00, 0x01, 0xC0, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00,0x00, 0x00, 0x01, 0xC0, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00,0x00, 0x00, 0x01, 0xC0, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00,0x00, 0x00, 0x01, 0xC0, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00,0x00, 0x00, 0x01, 0xC0, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00,0x00, 0x00, 0x01, 0xC0, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00,0x00, 0x00, 0x01, 0xC0, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00,0x00, 0x00, 0x01, 0xC0, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x01, 0xC0, 0x00, 0x00, 0x00,0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x01, 0xC0, 0x00, 0x00, 0x00,0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x01, 0xC0, 0x00, 0x00, 0x00,0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x00,0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00,0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00,0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x0C, 0x00,0x0C, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x1E, 0x00,0x1E, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1F, 0x00,0x3E, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x07, 0x80,0xF8, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x03, 0xE1,0xF0, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x01, 0xFF,0xE0, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xFF,0x80, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x3F,0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00,0x00, 0x01, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x03, 0xE0, 0x00, 0x00,0x00, 0x07, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x01, 0xF0, 0x00, 0x00,0x00, 0x0F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00,0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00,0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x80, 0x00,0x01, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xE0, 0x00,0x07, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xFE, 0x00,0x3F, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF,0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF,0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,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 ascii[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0x00, 0x00, 0x70, 0xF8, 0xF8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x0D, 0x00, 0x00, 0x00, //!0x00, 0x38, 0x38, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //"0x00, 0x20, 0xF8, 0xF8, 0x20, 0xF8, 0xF8, 0x20, 0x00, 0x02, 0x0F, 0x0F, 0x02, 0x0F, 0x0F, 0x02, //#0x00, 0x30, 0x78, 0xCE, 0x8E, 0x18, 0x10, 0x00, 0x00, 0x04, 0x0C, 0x38, 0x39, 0x0F, 0x06, 0x00, //$0x18, 0x3C, 0x24, 0xBC, 0xD8, 0x60, 0x30, 0x00, 0x00, 0x06, 0x03, 0x0D, 0x1E, 0x12, 0x1E, 0x0C, //%0x00, 0xB0, 0xF8, 0x48, 0x78, 0x30, 0x00, 0x00, 0x00, 0x07, 0x0F, 0x08, 0x09, 0x07, 0x0F, 0x09, //&0x00, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //'0x00, 0x00, 0xC0, 0xF0, 0x38, 0x08, 0x00, 0x00, 0x00, 0x00, 0x07, 0x1F, 0x38, 0x20, 0x00, 0x00, //(0x00, 0x00, 0x08, 0x38, 0xF0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x20, 0x38, 0x1F, 0x07, 0x00, 0x00, //)0x00, 0x80, 0xA0, 0xE0, 0xC0, 0xE0, 0xA0, 0x80, 0x00, 0x00, 0x02, 0x03, 0x01, 0x03, 0x02, 0x00, //*0x00, 0x80, 0x80, 0xE0, 0xE0, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, //+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2C, 0x3C, 0x1C, 0x00, 0x00, //,0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x0C, 0x0C, 0x00, 0x00, //.0x00, 0x00, 0x00, 0x80, 0xE0, 0x78, 0x18, 0x00, 0x00, 0x18, 0x1E, 0x07, 0x01, 0x00, 0x00, 0x00, ///0x00, 0x00, 0xF0, 0xF8, 0x08, 0x68, 0xF8, 0xF0, 0x00, 0x00, 0x07, 0x0F, 0x0B, 0x08, 0x0F, 0x07, // 00x00, 0x20, 0x20, 0x30, 0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, // 10x00, 0x30, 0x38, 0x08, 0x88, 0xF8, 0x70, 0x00, 0x00, 0x0C, 0x0E, 0x0B, 0x09, 0x08, 0x08, 0x00, // 20x00, 0x30, 0x38, 0x88, 0x88, 0xF8, 0x70, 0x00, 0x00, 0x06, 0x0E, 0x08, 0x08, 0x0F, 0x07, 0x00, // 30x00, 0x00, 0xF8, 0xF8, 0x00, 0xE0, 0xE0, 0x00, 0x00, 0x03, 0x03, 0x02, 0x02, 0x0F, 0x0F, 0x02, // 40x00, 0xF8, 0xF8, 0x88, 0x88, 0x88, 0x08, 0x00, 0x00, 0x08, 0x08, 0x08, 0x0C, 0x07, 0x03, 0x00, // 50x00, 0xC0, 0xE0, 0x78, 0x58, 0xC8, 0x80, 0x00, 0x00, 0x07, 0x0F, 0x08, 0x08, 0x0F, 0x07, 0x00, // 60x00, 0x08, 0x08, 0x88, 0xE8, 0x78, 0x18, 0x00, 0x00, 0x00, 0x0E, 0x0F, 0x01, 0x00, 0x00, 0x00, // 70x00, 0x70, 0xF8, 0xC8, 0x88, 0xF8, 0x70, 0x00, 0x00, 0x07, 0x0F, 0x08, 0x09, 0x0F, 0x07, 0x00, // 80x00, 0xF0, 0xF8, 0x08, 0x08, 0xF8, 0xF0, 0x00, 0x00, 0x00, 0x09, 0x0D, 0x0F, 0x03, 0x01, 0x00, // 90x00, 0x00, 0x00, 0x60, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x0C, 0x0C, 0x00, 0x00, //:0x00, 0x00, 0x00, 0x60, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2C, 0x3C, 0x1C, 0x00, 0x00, //;0x00, 0x80, 0xC0, 0x60, 0x30, 0x18, 0x08, 0x00, 0x00, 0x00, 0x01, 0x03, 0x06, 0x0C, 0x08, 0x00, //<0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, //=0x00, 0x08, 0x18, 0x30, 0x60, 0xC0, 0x80, 0x00, 0x00, 0x08, 0x0C, 0x06, 0x03, 0x01, 0x00, 0x00, //>0x00, 0x30, 0x38, 0x88, 0xC8, 0x78, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x0D, 0x00, 0x00, 0x00, //?0xF0, 0xF8, 0x08, 0x88, 0xC8, 0x48, 0xF8, 0xF0, 0x07, 0x0F, 0x08, 0x09, 0x0B, 0x0A, 0x0B, 0x0B, //@0x00, 0xE0, 0xF0, 0x18, 0x18, 0xF0, 0xE0, 0x00, 0x00, 0x0F, 0x0F, 0x01, 0x01, 0x0F, 0x0F, 0x00, // A0x00, 0xF8, 0xF8, 0x88, 0x88, 0xF8, 0x70, 0x00, 0x00, 0x0F, 0x0F, 0x08, 0x08, 0x0F, 0x07, 0x00, // B0x00, 0xF0, 0xF8, 0x08, 0x08, 0x38, 0x30, 0x00, 0x00, 0x07, 0x0F, 0x08, 0x08, 0x0E, 0x06, 0x00, // C0x00, 0xF8, 0xF8, 0x08, 0x18, 0xF0, 0xE0, 0x00, 0x00, 0x0F, 0x0F, 0x08, 0x0C, 0x07, 0x03, 0x00, // D0x00, 0xF8, 0xF8, 0x88, 0x88, 0x88, 0x08, 0x00, 0x00, 0x0F, 0x0F, 0x08, 0x08, 0x08, 0x08, 0x00, // E0x00, 0xF8, 0xF8, 0x88, 0x88, 0x88, 0x08, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, // F0x00, 0xF0, 0xF8, 0x08, 0x08, 0x38, 0x30, 0x00, 0x00, 0x07, 0x0F, 0x08, 0x09, 0x0F, 0x0F, 0x00, // G0x00, 0xF8, 0xF8, 0x80, 0x80, 0xF8, 0xF8, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x0F, 0x0F, 0x00, // H0x00, 0x00, 0x08, 0xF8, 0xF8, 0x08, 0x00, 0x00, 0x00, 0x00, 0x08, 0x0F, 0x0F, 0x08, 0x00, 0x00, // I0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xF8, 0x00, 0x00, 0x06, 0x0E, 0x08, 0x08, 0x0F, 0x07, 0x00, // J0x00, 0xF8, 0xF8, 0x80, 0xE0, 0x78, 0x18, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x03, 0x0F, 0x0C, 0x00, // K0x00, 0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x08, 0x08, 0x08, 0x08, 0x00, // L0x00, 0xF8, 0xF8, 0x20, 0xC0, 0x20, 0xF8, 0xF8, 0x00, 0x0F, 0x0F, 0x00, 0x01, 0x00, 0x0F, 0x0F, // M0x00, 0xF8, 0xF8, 0x60, 0xC0, 0x80, 0xF8, 0xF8, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x01, 0x0F, 0x0F, // N0x00, 0xF0, 0xF8, 0x08, 0x08, 0xF8, 0xF0, 0x00, 0x00, 0x07, 0x0F, 0x08, 0x08, 0x0F, 0x07, 0x00, // O0x00, 0xF8, 0xF8, 0x88, 0x88, 0xF8, 0x70, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, // P0x00, 0xF0, 0xF8, 0x08, 0x08, 0xF8, 0xF0, 0x00, 0x00, 0x07, 0x0F, 0x08, 0x18, 0x3F, 0x27, 0x00, // Q0x00, 0xF8, 0xF8, 0x88, 0x88, 0xF8, 0x70, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x01, 0x0F, 0x0E, 0x00, // R0x00, 0x30, 0x78, 0xC8, 0x88, 0x18, 0x10, 0x00, 0x00, 0x04, 0x0C, 0x08, 0x09, 0x0F, 0x06, 0x00, // S0x00, 0x08, 0x08, 0xF8, 0xF8, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, // T0x00, 0xF8, 0xF8, 0x00, 0x00, 0xF8, 0xF8, 0x00, 0x00, 0x07, 0x0F, 0x08, 0x08, 0x0F, 0x07, 0x00, // U0x00, 0xF8, 0xF8, 0x00, 0x00, 0xF8, 0xF8, 0x00, 0x00, 0x03, 0x07, 0x0C, 0x0C, 0x07, 0x03, 0x00, // V0x00, 0xF8, 0xF8, 0x00, 0xC0, 0x00, 0xF8, 0xF8, 0x00, 0x01, 0x0F, 0x0E, 0x01, 0x0E, 0x0F, 0x01, // W0x00, 0x18, 0x38, 0xE0, 0xC0, 0x38, 0x18, 0x00, 0x00, 0x0E, 0x0F, 0x00, 0x01, 0x0F, 0x0E, 0x00, // X0x00, 0x78, 0xF8, 0x80, 0x80, 0xF8, 0x78, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, // Y0x00, 0x08, 0x08, 0x88, 0xC8, 0x78, 0x38, 0x00, 0x00, 0x0E, 0x0F, 0x09, 0x08, 0x08, 0x08, 0x00, // Z0x00, 0x00, 0xF8, 0xF8, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x7F, 0x40, 0x40, 0x00, 0x00, //[0x00, 0x18, 0x78, 0xE0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07, 0x1E, 0x18, 0x00, //0x00, 0x00, 0x08, 0x08, 0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x7F, 0x7F, 0x00, 0x00, //]0x00, 0x08, 0x0C, 0x06, 0x06, 0x0C, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //^0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, //_0x00, 0x00, 0x02, 0x06, 0x0E, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //`0x00, 0x00, 0x20, 0x20, 0x20, 0xE0, 0xC0, 0x00, 0x00, 0x06, 0x0F, 0x09, 0x09, 0x0F, 0x0F, 0x00, // a0x00, 0xF8, 0xF8, 0x20, 0x20, 0xE0, 0xC0, 0x00, 0x00, 0x0F, 0x0F, 0x08, 0x08, 0x0F, 0x07, 0x00, // b0x00, 0xC0, 0xE0, 0x20, 0x20, 0x60, 0x40, 0x00, 0x00, 0x07, 0x0F, 0x08, 0x08, 0x0C, 0x04, 0x00, // c0x00, 0xC0, 0xE0, 0x20, 0x20, 0xF8, 0xF8, 0x00, 0x00, 0x07, 0x0F, 0x08, 0x08, 0x0F, 0x0F, 0x00, // d0x00, 0xC0, 0xE0, 0x20, 0x20, 0xE0, 0xC0, 0x00, 0x00, 0x07, 0x0F, 0x09, 0x09, 0x09, 0x01, 0x00, // e0x00, 0x80, 0xF0, 0xF8, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, // f0x00, 0xC0, 0xE0, 0x20, 0x20, 0xE0, 0xE0, 0x00, 0x00, 0x47, 0x4F, 0x48, 0x48, 0x7F, 0x3F, 0x00, // g0x00, 0xF8, 0xF8, 0x20, 0x20, 0xE0, 0xC0, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x0F, 0x0F, 0x00, // h0x00, 0x20, 0x20, 0xEC, 0xEC, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x0F, 0x0F, 0x08, 0x08, 0x00, // i0x00, 0x00, 0x20, 0x20, 0xEC, 0xEC, 0x00, 0x00, 0x00, 0x40, 0x40, 0x40, 0x7F, 0x3F, 0x00, 0x00, // j0x00, 0xF8, 0xF8, 0x00, 0x80, 0xE0, 0x60, 0x00, 0x00, 0x0F, 0x0F, 0x01, 0x03, 0x0E, 0x0C, 0x00, // k0x00, 0x08, 0x08, 0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x0F, 0x0F, 0x08, 0x08, 0x00, // l0x00, 0xE0, 0xE0, 0x20, 0xE0, 0x20, 0xE0, 0xC0, 0x00, 0x0F, 0x0F, 0x00, 0x07, 0x00, 0x0F, 0x0F, // m0x00, 0xE0, 0xE0, 0x20, 0x20, 0xE0, 0xC0, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x0F, 0x0F, 0x00, // n0x00, 0xC0, 0xE0, 0x20, 0x20, 0xE0, 0xC0, 0x00, 0x00, 0x07, 0x0F, 0x08, 0x08, 0x0F, 0x07, 0x00, // o0x00, 0xE0, 0xE0, 0x20, 0x20, 0xE0, 0xC0, 0x00, 0x00, 0x7F, 0x7F, 0x08, 0x08, 0x0F, 0x07, 0x00, // p0x00, 0xC0, 0xE0, 0x20, 0x20, 0xE0, 0xE0, 0x00, 0x00, 0x07, 0x0F, 0x08, 0x08, 0x7F, 0x7F, 0x00, // q0x00, 0xE0, 0xE0, 0x80, 0x40, 0x60, 0x60, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, // r0x00, 0xC0, 0xE0, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x08, 0x09, 0x09, 0x09, 0x0F, 0x06, 0x00, // s0x00, 0x20, 0xF8, 0xF8, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x07, 0x0F, 0x08, 0x08, 0x08, 0x00, // t0x00, 0xE0, 0xE0, 0x00, 0x00, 0xE0, 0xE0, 0x00, 0x00, 0x07, 0x0F, 0x08, 0x08, 0x0F, 0x0F, 0x00, // u0x00, 0xE0, 0xE0, 0x00, 0x00, 0xE0, 0xE0, 0x00, 0x00, 0x03, 0x07, 0x0C, 0x0C, 0x07, 0x03, 0x00, // v0x00, 0xE0, 0xE0, 0x00, 0xC0, 0x00, 0xE0, 0xE0, 0x00, 0x03, 0x0F, 0x0C, 0x03, 0x0C, 0x0F, 0x03, // w0x00, 0x60, 0xE0, 0x80, 0x80, 0xE0, 0x60, 0x00, 0x00, 0x0C, 0x0E, 0x03, 0x03, 0x0E, 0x0C, 0x00, // x0x00, 0xE0, 0xE0, 0x00, 0x00, 0xE0, 0xE0, 0x00, 0x40, 0x47, 0x4F, 0x68, 0x38, 0x1F, 0x07, 0x00, // y0x00, 0x20, 0x20, 0x20, 0xA0, 0xE0, 0x60, 0x00, 0x00, 0x0C, 0x0E, 0x0B, 0x09, 0x08, 0x08, 0x00, // z0x00, 0x00, 0x80, 0xF0, 0x78, 0x08, 0x00, 0x00, 0x00, 0x01, 0x03, 0x1E, 0x3C, 0x20, 0x00, 0x00, //{0x00, 0x00, 0x00, 0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x7F, 0x00, 0x00, 0x00, //|0x00, 0x00, 0x08, 0x78, 0xF0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x20, 0x3C, 0x1E, 0x03, 0x01, 0x00, //}0x30, 0x18, 0x08, 0x18, 0x30, 0x20, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 //~
};// ok image
const unsigned char bmp1[] = {//-- 调入了一幅图像:D:\我的文档\My Pictures\12864-555.bmp -- //-- 宽度 x 高度=128x64 --0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xC0,0xC0,0xC0,0xC0,0xE0,0x60,0xE0,0xE0,0xE0,0xE0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0xE0,0xE0,0xE0,0xE0,0xC0,0xC0,0xC0,0xC0,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,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,0xC0,0xE0,0x70,0x38,0x18,0x1C,0x0C,0x0E,0x07,0x03,0x03,0x01,0x81,0xE0,0x78,0x1C,0x0E,0x07,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x07,0x0E,0x1C,0x79,0xE1,0x83,0x03,0x07,0x0E,0x0C,0x1C,0x18,0x38,0x70,0xE0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xC0,0xC0,0xC0,0xC0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xC0,0xC0,0xC0,0xC0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xF0,0x78,0x1E,0x07,0x03,0x81,0x80,0xC0,0xC0,0xC0,0xE0,0x60,0x60,0x60,0x70,0xF0,0xFE,0x3F,0x19,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x38,0x31,0x3F,0xFE,0xF0,0x60,0x60,0xE0,0xC0,0xC0,0xC0,0x80,0x81,0x03,0x07,0x1E,0x78,0xF0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xFC,0xFF,0x7F,0x07,0x0F,0x1F,0x3D,0x79,0x71,0xF0,0xE0,0xC0,0x80,0x00,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,0x80,0xC0,0xE0,0xF0,0x71,0x79,0x3D,0x1F,0x0F,0xFF,0xFE,0xFC,0x00,0x00,0x00,0x00,0x00,0x80,0xFE,0xFF,0xF9,0x1C,0x0E,0x07,0x03,0x03,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,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,0xFF,0xFF,0x00,0x00,0x00,0x00,0x01,0x01,0x03,0x03,0x07,0x0E,0x1C,0xF9,0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x07,0x0F,0x0E,0x9E,0xFC,0xF8,0xF0,0xE0,0xC0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xC0,0xE0,0xF0,0xF8,0xF8,0xFC,0x9E,0x0F,0x07,0x03,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xDF,0x38,0x70,0xE0,0xC0,0xC0,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,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,0xFF,0xFF,0x00,0x00,0x00,0x00,0x80,0x80,0xC0,0xC0,0xE0,0x70,0x38,0xDF,0xFF,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xE0,0xF0,0x78,0x3C,0x1E,0x0F,0x07,0x03,0x01,0x00,0x01,0x01,0x03,0x07,0x0F,0x1E,0x1E,0x0E,0x0F,0x07,0x03,0x01,0x01,0x00,0x01,0x01,0x03,0x07,0x0F,0x1E,0x3C,0x78,0xF0,0xE0,0xC0,0x80,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x0F,0x3C,0x70,0xE0,0xC1,0x81,0x03,0x03,0x03,0x07,0x06,0x06,0x06,0x0E,0x0F,0x7F,0xFC,0x98,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x0C,0x8C,0xFC,0x7F,0x0F,0x06,0x06,0x07,0x03,0x03,0x03,0x81,0xC1,0xE0,0x70,0x3C,0x0F,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x1F,0x3F,0x7C,0xFC,0xFE,0xEF,0xE7,0xE3,0xE1,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE1,0xE3,0xE7,0xEF,0xFE,0x7C,0x3F,0x1F,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x07,0x0E,0x0C,0x1C,0x18,0x38,0x70,0x60,0xE0,0xC0,0xC1,0x87,0x9E,0xB8,0xF0,0xE0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xE0,0xF0,0xB8,0xDE,0xC7,0xE1,0x60,0x70,0x38,0x18,0x1C,0x0C,0x0E,0x07,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x03,0x03,0x03,0x03,0x03,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x03,0x03,0x03,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};const unsigned char txw_tech[] = {/*-- 文字: 阿 --*//*-- 幼圆20; 此字体下对应的点阵为:宽x高=28x27 --*//*-- 高度不是8的倍数,现调整为:宽度x高度=28x32 --*/0x00,0xF0,0xF8,0xF8,0x08,0x88,0xF8,0xF8,0x38,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0xF8,0xF8,0xF8,0x08,0x08,0x08,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x1F,0x7F,0xF9,0xE0,0x80,0xFE,0xFF,0xFF,0x01,0x01,0x01,0x01,0x01,0xFF,0xFF,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x08,0x08,0x08,0x0F,0x0F,0x07,0x0F,0x0F,0x0F,0x08,0x08,0x08,0x08,0x08,0x0F,0x0F,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x07,0x07,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x02,0x06,0x06,0x06,0x04,0x07,0x07,0x03,0x00,0x00,0x00,0x00,/*-- 文字: 武 --*//*-- 幼圆20; 此字体下对应的点阵为:宽x高=28x27 --*//*-- 高度不是8的倍数,现调整为:宽度x高度=28x32 --*/0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0xFC,0xFC,0xF8,0x0C,0x1C,0x3C,0x78,0x70,0x40,0x00,0x00,0x00,0x01,0x01,0x01,0xF1,0xF1,0xF1,0x01,0x01,0x01,0xFF,0xFF,0xFF,0xC1,0xC1,0xC1,0xC1,0xC3,0xFF,0xFF,0xF1,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x80,0xFF,0xFF,0xFF,0xC0,0xC0,0xC0,0x40,0x60,0x60,0x27,0x3F,0xFF,0xF0,0xC0,0x00,0xFC,0xFC,0xFC,0x00,0x02,0x02,0x03,0x03,0x03,0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x07,0x07,0x07,0x01,0x00,/*-- 文字: 科 --*//*-- 幼圆20; 此字体下对应的点阵为:宽x高=28x27 --*//*-- 高度不是8的倍数,现调整为:宽度x高度=28x32 --*/0x00,0x08,0x08,0x08,0x08,0xF8,0xF8,0xF8,0x0C,0x0C,0x0C,0x04,0x00,0x08,0x18,0x38,0x70,0xE0,0xC0,0x80,0x00,0xFC,0xFC,0xFC,0x00,0x00,0x00,0x00,0x02,0x06,0x06,0x86,0xF6,0xFF,0xFF,0xFF,0x7E,0xF6,0xC6,0x86,0x0C,0x0C,0x1C,0x38,0x70,0xE0,0xC1,0x87,0x07,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x10,0x1C,0x1E,0x0F,0x03,0xFF,0xFF,0xFF,0x00,0x01,0x13,0x13,0x12,0x18,0x18,0x18,0x18,0x09,0x09,0x09,0x08,0xFF,0xFF,0xFF,0x0C,0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x07,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x07,0x07,0x00,0x00,0x00,0x00,/*-- 文字: 技 --*//*-- 幼圆20; 此字体下对应的点阵为:宽x高=28x27 --*//*-- 高度不是8的倍数,现调整为:宽度x高度=28x32 --*/0x00,0x00,0x00,0x00,0xFC,0xFC,0xFC,0x00,0x40,0x60,0x60,0x60,0x60,0x60,0x60,0xFC,0xFC,0xFC,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x01,0x01,0x01,0x01,0xFF,0xFF,0xFF,0xC1,0xC1,0x49,0x09,0x78,0xF8,0xE8,0x88,0x0F,0x0F,0x0F,0x08,0x08,0x88,0xE8,0xF8,0x78,0x10,0x00,0x00,0x00,0x04,0x06,0x06,0x07,0xFF,0xFF,0xFF,0x01,0x00,0x00,0x00,0x80,0x81,0xC3,0xCF,0x7E,0x7C,0x78,0x7C,0xEE,0xC7,0x83,0x81,0x00,0x00,0x00,0x00,0x00,0x02,0x02,0x02,0x02,0x03,0x03,0x03,0x02,0x02,0x03,0x03,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x03,0x03,0x06,0x06,0x00,0x00,/*-- 文字: 鸿 --*//*-- 幼圆20; 此字体下对应的点阵为:宽x高=28x27 --*//*-- 高度不是8的倍数,现调整为:宽度x高度=28x32 --*/0x00,0x08,0x18,0x38,0xF0,0xE0,0xD0,0x10,0x10,0xF0,0xF0,0x10,0x10,0xF0,0xE0,0xF0,0xB0,0xBC,0xBC,0x3C,0x30,0xF0,0xE0,0xE0,0x00,0x00,0x00,0x00,0x00,0x04,0x1C,0x3C,0x78,0x70,0xC0,0x80,0x00,0xFF,0xFF,0x00,0x00,0x7F,0xFF,0xFF,0x80,0x91,0x93,0x93,0x92,0x9F,0x9F,0x9F,0x80,0x00,0x00,0x00,0x00,0x00,0xC0,0xF0,0xFC,0x3F,0x8F,0x81,0xC0,0xFF,0x7F,0x38,0x1C,0x1C,0x14,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x03,0x03,0x01,0x00,0x03,0x03,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x01,0x00,0x00,/*-- 文字: 蒙 --*//*-- 幼圆20; 此字体下对应的点阵为:宽x高=28x27 --*//*-- 高度不是8的倍数,现调整为:宽度x高度=28x32 --*/0x00,0x18,0x18,0x98,0x98,0x98,0x98,0xBC,0xBE,0xBE,0x98,0x98,0x98,0x98,0x98,0x98,0x98,0xBE,0xBE,0xBC,0x98,0x98,0x98,0x98,0x98,0x00,0x00,0x00,0x00,0x00,0x0F,0x1F,0x3F,0x34,0xB6,0xB6,0xB6,0xF6,0xF6,0xF6,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0xB6,0xB4,0xBC,0x3F,0x0F,0x03,0x00,0x00,0x00,0x00,0x03,0x13,0x13,0x19,0x99,0x89,0x8D,0xCD,0xCE,0x66,0x77,0x3F,0xFF,0xFE,0xF6,0x0F,0x1F,0x3F,0x71,0x61,0xC0,0xC0,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x03,0x03,0x01,0x01,0x01,0x01,0x02,0x06,0x06,0x06,0x06,0x07,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x00,/*-- 文字: 之 --*//*-- 幼圆20; 此字体下对应的点阵为:宽x高=28x27 --*//*-- 高度不是8的倍数,现调整为:宽度x高度=28x32 --*/0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x86,0x9E,0xFC,0xF8,0xE0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x81,0xC1,0xC1,0xE1,0x79,0x3D,0x1F,0x0F,0x03,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xC0,0xC0,0x60,0x60,0xF0,0xF0,0xB8,0x18,0x1C,0x0C,0x06,0x07,0x03,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x03,0x01,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00,0x00,/*-- 文字: 家 --*//*-- 幼圆20; 此字体下对应的点阵为:宽x高=28x27 --*//*-- 高度不是8的倍数,现调整为:宽度x高度=28x32 --*/0x00,0xC0,0xF0,0xF0,0x30,0x10,0x10,0x10,0x10,0x10,0x10,0x14,0x1E,0x1E,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x30,0xF0,0xF0,0xE0,0x00,0x00,0x00,0x03,0x87,0xC7,0xC1,0x41,0x61,0x61,0x31,0x39,0x19,0xBD,0xFF,0xE7,0xC3,0xC1,0xE1,0xF1,0xF9,0x39,0x19,0x01,0x06,0x07,0x07,0x00,0x00,0x00,0x00,0x00,0x10,0x18,0x98,0x98,0x8C,0xCC,0xC6,0x66,0x73,0x33,0x39,0x9F,0xFF,0xFF,0x79,0x07,0x1F,0x3E,0x78,0xF0,0xE0,0xC0,0x80,0x80,0x00,0x00,0x00,0x02,0x03,0x03,0x01,0x01,0x03,0x06,0x06,0x06,0x04,0x06,0x06,0x07,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x00,};/
// Bitmap点阵数据表 //
// 图片: E:\..H砑223.bmp,横向取模左高位,数据排列:从左到右从上到下 //
// 图片尺寸: 104 * 46 //
/
static const unsigned char nPianWoFish[] = {/// Bitmap点阵数据表 //// 图片: E:\..H砑328.bmp,横向取模左高位,数据排列:从左到右从上到下 //// 图片尺寸: 104 * 46 ///0x00, 0x00, 0x00, 0x00, 0x01, 0xE0, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x07, 0xE0, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x0F, 0x80, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFE, 0x00,0x00, 0x00, 0x00, 0x00, 0x7E, 0x03, 0x00, 0x00,0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFE, 0x00,0x00, 0x00, 0x00, 0x00, 0xFE, 0x1F, 0x00, 0x00,0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xC0, 0x00,0x00, 0x00, 0x00, 0x01, 0xFE, 0x7C, 0x00, 0x00,0x00, 0x00, 0x03, 0xFF, 0xFF, 0xFC, 0x00, 0x00,0x00, 0x00, 0x00, 0x03, 0xFF, 0xF0, 0x00, 0x00,0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xE0, 0x00, 0x00,0x00, 0x00, 0x00, 0x07, 0xFF, 0xC0, 0x00, 0x00,0x00, 0x00, 0x7C, 0xFF, 0xFF, 0x80, 0x00, 0x00,0x00, 0x00, 0x00, 0x07, 0xFF, 0x00, 0x3F, 0xFF,0xFF, 0xFF, 0xF1, 0x1F, 0xFF, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x0F, 0xFE, 0x7F, 0xFF, 0xFF,0xF1, 0xEF, 0xC0, 0xFF, 0xFE, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0x0C, 0x67,0xBF, 0xFF, 0xE0, 0x3F, 0xFC, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x1F, 0xFC, 0x00, 0xEF, 0x79,0xFF, 0xBB, 0xE7, 0xFF, 0xF8, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x7F, 0xF0, 0x06, 0xF3, 0x9F,0xFB, 0xFF, 0xE3, 0xDF, 0xF8, 0x00, 0x00, 0x00,0x00, 0x00, 0x03, 0xFF, 0xE0, 0xE7, 0x3F, 0xFF,0xFF, 0xF7, 0xC0, 0x7F, 0xF0, 0x00, 0x00, 0x00,0x00, 0x00, 0x1F, 0xBF, 0x80, 0xF3, 0xBF, 0x7F,0xFF, 0xFF, 0xE0, 0x7F, 0xFE, 0x00, 0x00, 0x00,0x00, 0x00, 0x7C, 0x7C, 0x03, 0x3F, 0xF7, 0xFF,0xFF, 0xDF, 0xE0, 0x87, 0xFE, 0x00, 0x00, 0x00,0x00, 0x01, 0xF0, 0xF8, 0x13, 0xFE, 0xFF, 0xCF,0xFD, 0xFF, 0xE0, 0xFF, 0xFF, 0xC0, 0x00, 0x00,0x00, 0x03, 0xE1, 0xF0, 0x1C, 0xEF, 0xFF, 0xFF,0xDF, 0xFF, 0xC0, 0x7F, 0xFD, 0xF0, 0x00, 0x00,0x00, 0x0F, 0xF3, 0xF0, 0x8E, 0xFF, 0xDF, 0xBF,0xFF, 0xFF, 0xF8, 0x20, 0xFF, 0xF8, 0x00, 0x00,0x00, 0x1F, 0x07, 0xE0, 0xFF, 0xFF, 0xFB, 0xFF,0xE0, 0x00, 0x3E, 0x3F, 0xFF, 0xFE, 0x00, 0x00,0x00, 0x3F, 0x07, 0xE0, 0x7B, 0xFF, 0x7F, 0xFC,0x00, 0x00, 0x07, 0xCF, 0xFF, 0xFF, 0xE0, 0x00,0x00, 0x7B, 0xF7, 0xE1, 0xBF, 0xF7, 0xFF, 0xFF,0xE0, 0x00, 0x01, 0xF9, 0xFF, 0xFF, 0xF0, 0x00,0x00, 0x7B, 0xF7, 0xE3, 0xFF, 0x7E, 0xFF, 0xFF,0xE0, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0x00,0x00, 0xFF, 0xD7, 0xE0, 0xFF, 0xFF, 0xF3, 0xF8,0x00, 0x00, 0x00, 0x03, 0xFF, 0xFF, 0xFF, 0xFC,0x01, 0xCE, 0xF7, 0xE0, 0xFD, 0xFF, 0x8F, 0xE0,0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF,0x01, 0xFE, 0xE7, 0xE3, 0xFF, 0xFE, 0x0F, 0x80,0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x9F,0x03, 0xF7, 0xC7, 0xE3, 0xFB, 0xF8, 0x1F, 0x80,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x03, 0xE7, 0x9B, 0xF0, 0x3F, 0xE0, 0xFF, 0xC0,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x03, 0xBF, 0xB9, 0xF0, 0x3F, 0xFF, 0xFF, 0xF8,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x07, 0x3D, 0xF0, 0xF0, 0x37, 0xFF, 0xFF, 0xFE,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x07, 0xF9, 0xE6, 0xF0, 0x3F, 0x00, 0x0F, 0xFE,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x07, 0xEF, 0xFF, 0x38, 0x1C, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x07, 0xCF, 0x78, 0xC0, 0x0E, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x07, 0xFE, 0xF9, 0xC0, 0x07, 0x80, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x06, 0x77, 0xFF, 0xCE, 0x0B, 0xE0, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x07, 0xF3, 0x9F, 0xFC, 0x00, 0xFC, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x07, 0xBF, 0xBC, 0xF9, 0xC0, 0x3F, 0xF0, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x07, 0x9E, 0xFD, 0xF7, 0xCE, 0x03, 0xFF, 0x80,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x07, 0xFC, 0xE7, 0xBF, 0xBE, 0x20, 0x0F, 0xE0,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x03, 0xEF, 0xEF, 0x3D, 0xFC, 0xF3, 0x00, 0xFC,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x03, 0xEF, 0x3F, 0xFC, 0xEF, 0xCF, 0x80, 0x1F,0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x01, 0xFF, 0x79, 0xEF, 0xE7, 0x1E, 0x00, 0x03,0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x01, 0xFB, 0xFB, 0xCF, 0x7F, 0x78, 0x00, 0x3F,0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0xFB, 0xDF, 0xFE, 0x7F, 0xF9, 0xC1, 0x7F,0x09, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x7F, 0xDE, 0x7B, 0xF9, 0xDF, 0xC0, 0xE0,0x7F, 0xB8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0x3E, 0xFE, 0xF3, 0xDF, 0xDE, 0x00, 0xC0,0x7F, 0x9E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF, 0xFF, 0xF7, 0xFF, 0xDE, 0xFE, 0xF1, 0xC0,0x7F, 0x87, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,0x1F, 0xFF, 0xFF, 0x9E, 0xDE, 0xF7, 0xE1, 0xC0,0x1C, 0x0F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00,0x03, 0xFF, 0xFF, 0xBC, 0xFF, 0xF3, 0x80, 0xC0,0x00, 0x1F, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00,0x01, 0xFF, 0xFD, 0xFD, 0xE7, 0xBF, 0x80, 0xC2,0x00, 0x3F, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0xFF, 0xFF, 0xEF, 0xFF, 0xBD, 0xC0, 0xE3,0x80, 0x3F, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00,0x00, 0x39, 0xFF, 0xEF, 0x3D, 0xFC, 0xE0, 0xF3,0xC0, 0x1F, 0xFB, 0xE0, 0x00, 0x00, 0x00, 0x00,0x00, 0x0F, 0xFE, 0x7F, 0x79, 0xEC, 0x60, 0xFA,0xFF, 0xFD, 0xF7, 0xFE, 0x00, 0x00, 0x00, 0x00,0x00, 0x3E, 0x0F, 0xBB, 0xFF, 0xC6, 0x00, 0xF8,0x7F, 0xFF, 0xFF, 0xE6, 0x00, 0x00, 0x00, 0x00,0x00, 0x3F, 0xFF, 0xF9, 0xCF, 0x7F, 0x00, 0x7E,0x0F, 0x83, 0xF7, 0xE6, 0x00, 0x00, 0x00, 0x00,0x00, 0x7F, 0xF0, 0x7E, 0xCF, 0xFF, 0x80, 0x3F,0x00, 0x0E, 0x0F, 0xD6, 0x00, 0x00, 0x00, 0x00,0x00, 0x7F, 0x80, 0x0F, 0xFF, 0xF6, 0x00, 0x3F,0x98, 0x7E, 0x0F, 0xCE, 0x00, 0x00, 0x00, 0x00,0x00, 0xFE, 0x00, 0x01, 0xFF, 0xDE, 0x00, 0x3F,0xFF, 0xF0, 0x1F, 0x8C, 0x00, 0x00, 0x00, 0x00,0x03, 0xFC, 0x00, 0x07, 0xFF, 0xFF, 0xC0, 0x1F,0xFF, 0xFF, 0xFE, 0x1C, 0x00, 0x00, 0x00, 0x00,0x03, 0xF0, 0x00, 0x1F, 0xFF, 0xFF, 0xF8, 0x07,0xFF, 0x9F, 0xF0, 0x78, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x3F, 0xFF, 0xF9, 0x9F, 0xFF,0xFF, 0xF8, 0x1F, 0xE0, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x7F, 0x0F, 0x87, 0x01, 0xFC,0x00, 0x7F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00};
/
// Bitmap点阵数据表 //
// 图片: E:\..hmos_副本.bmp,横向取模左高位,数据排列:从左到右从上到下 //
// 图片尺寸: 128 * 64 //
/
const unsigned char hmosLogo[] = // 数据表{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x0F, 0xF8, 0x20, 0x82, 0x22, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x80, 0x11, 0x02, 0x22, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x80, 0x0A, 0x01, 0x54, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x80, 0x04, 0x01, 0x54, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x80, 0x0A, 0x00, 0x88, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x80, 0x11, 0x00, 0x88, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x80, 0x20, 0x80, 0x88, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x0F, 0x00, 0xE0, 0x00, 0x00,0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x3F, 0x81, 0x98, 0x00, 0x00,0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x60, 0xC2, 0x08, 0x00, 0x00,0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x40, 0x42, 0x08, 0x00, 0x00,0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x80, 0x22, 0x00, 0x00, 0x00,0x00, 0x02, 0x01, 0x06, 0x00, 0x02, 0x08, 0x04,0x00, 0x00, 0x00, 0x80, 0x22, 0x00, 0x00, 0x00,0x00, 0x02, 0x01, 0x1F, 0x0B, 0x87, 0x1C, 0x1F,0x07, 0xC4, 0x08, 0x80, 0x12, 0x00, 0x00, 0x00,0x00, 0x02, 0x01, 0x10, 0x8C, 0x08, 0x42, 0x31,0x88, 0x24, 0x09, 0x00, 0x11, 0x00, 0x00, 0x00,0x00, 0x03, 0xFF, 0x00, 0x88, 0x08, 0x42, 0x20,0x88, 0x22, 0x11, 0x00, 0x11, 0xC0, 0x00, 0x00,0x00, 0x03, 0xFF, 0x00, 0x88, 0x08, 0x42, 0x40,0x88, 0x22, 0x11, 0x00, 0x10, 0x70, 0x00, 0x00,0x00, 0x02, 0x01, 0x00, 0x88, 0x08, 0x42, 0x40,0x88, 0x22, 0x11, 0x00, 0x10, 0x18, 0x00, 0x00,0x00, 0x02, 0x01, 0x0F, 0x88, 0x08, 0x42, 0x40,0x88, 0x22, 0x11, 0x00, 0x10, 0x0C, 0x00, 0x00,0x00, 0x02, 0x01, 0x10, 0x88, 0x08, 0x42, 0x40,0x88, 0x21, 0x20, 0x80, 0x20, 0x04, 0x00, 0x00,0x00, 0x02, 0x01, 0x20, 0x88, 0x08, 0x42, 0x40,0x88, 0x21, 0x40, 0x80, 0x20, 0x04, 0x00, 0x00,0x00, 0x02, 0x01, 0x20, 0x88, 0x08, 0x42, 0x40,0x88, 0x20, 0x80, 0x40, 0x20, 0x04, 0x00, 0x00,0x00, 0x02, 0x01, 0x20, 0x88, 0x08, 0x42, 0x20,0x88, 0x20, 0x80, 0x60, 0x42, 0x04, 0x00, 0x00,0x00, 0x02, 0x01, 0x11, 0x88, 0x08, 0x42, 0x11,0x08, 0x20, 0x80, 0x31, 0x83, 0x08, 0x00, 0x00,0x00, 0x02, 0x01, 0x1E, 0x88, 0x08, 0x42, 0x0E,0x08, 0x20, 0x80, 0x1F, 0x00, 0xF0, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x80, 0x7F, 0xE0, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x80, 0x7F, 0xE0, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x01, 0x00, 0x7F, 0xE0, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x02, 0x00, 0x7F, 0xE0, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
// 联网相关的变量
static EventGroupHandle_t s_wifi_event_group; // 事件组,用于对wifi响应结果进行标记
static int s_retry_num = 0; // 记录wifi重新连接尝试的次数static const char *TAG = "esp32idf_title_txwtech";
static void obtain_time(void);
static void initialize_sntp(void);/*** @description: 处理wifi连接和ip分配时候事件的回调函数* @return {*}* @note:*/
static void event_handler(void *arg, esp_event_base_t event_base,int32_t event_id, void *event_data)
{// 如果是wifi station开始连接事件,就尝试将station连接到APif (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_START){esp_wifi_connect();}// 如果是wifi station从AP断连事件else if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_DISCONNECTED){// 如果没有达到最高尝试次数,继续尝试if (s_retry_num < EXAMPLE_ESP_MAXIMUM_RETRY){esp_wifi_connect();s_retry_num++;ESP_LOGI(TAG, "retry to connect to the AP ^_^");}// 如果达到了最高尝试次数,就标记连接失败else{xEventGroupSetBits(s_wifi_event_group, WIFI_FAIL_BIT);}ESP_LOGI(TAG, "connect to the AP fail *_*");}else if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP){ip_event_got_ip_t *event = (ip_event_got_ip_t *)event_data;ESP_LOGI(TAG, "got ip:" IPSTR, IP2STR(&event->ip_info.ip));s_retry_num = 0;xEventGroupSetBits(s_wifi_event_group, WIFI_CONNECTED_BIT); // 成功获取到了ip,就标记这次wifi连接成功}
}/*** @description: 用于连接wifi的函数* @return {*}* @note: 这里wifi连接选项设置了使用nvs,会把每次配置的参数存储在nvs中。因此请查看分区表中是否对nvs分区进行了设置*/
void wifi_init_sta(void)
{// 00 创建wifi事件组s_wifi_event_group = xEventGroupCreate();/******************** 01 Wi-Fi/LwIP 初始化阶段 ********************/// 01-1 创建LWIP核心任务ESP_ERROR_CHECK(esp_netif_init());// 01-2 创建系统事件任务,并初始化应用程序事件的回调函数ESP_ERROR_CHECK(esp_event_loop_create_default());// 01-3 创建有 TCP/IP 堆栈的默认网络接口实例绑定 stationesp_netif_create_default_wifi_sta();// 01-4 创建wifi驱动程序任务,并初始化wifi驱动程序wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();ESP_ERROR_CHECK(esp_wifi_init(&cfg));// 01-5 注册,用于处理wifi连接的过程中的事件esp_event_handler_instance_t instance_any_id; // 用于处理wifi连接时候的事件的句柄esp_event_handler_instance_t instance_got_ip; // 用于处理ip分配时候产生的事件的句柄// 该句柄对wifi连接所有事件都产生响应,连接到event_handler回调函数ESP_ERROR_CHECK(esp_event_handler_instance_register(WIFI_EVENT,ESP_EVENT_ANY_ID,&event_handler,NULL,&instance_any_id));// 该句柄仅仅处理IP_EVENT事件组中的从AP中获取ip地址事件,连接到event_handler回调函数ESP_ERROR_CHECK(esp_event_handler_instance_register(IP_EVENT,IP_EVENT_STA_GOT_IP,&event_handler,NULL,&instance_got_ip));/******************** 02 WIFI配置阶段 ********************/wifi_config_t wifi_config = {.sta = {.ssid = EXAMPLE_ESP_WIFI_SSID,.password = EXAMPLE_ESP_WIFI_PASS,/* Setting a password implies station will connect to all security modes including WEP/WPA.* However these modes are deprecated and not advisable to be used. Incase your Access point* doesn't support WPA2, these mode can be enabled by commenting below line */.threshold.authmode = WIFI_AUTH_WPA2_PSK, // 设置快速扫描模式下能接受的最弱的验证模式.sae_pwe_h2e = WPA3_SAE_PWE_BOTH, // 设置SAE和PWE(wifi协议)的配置},};// 02-2 配置station工作模式ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA));// 02-3 配置ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wifi_config));/******************** 03 wifi启动阶段 ********************/// 03-1 启动wifi驱动程序ESP_ERROR_CHECK(esp_wifi_start()); // 会触发回调函数ESP_LOGI(TAG, "wifi_init_sta finished.");/* Waiting until either the connection is established (WIFI_CONNECTED_BIT) or connection failed for the maximum* number of re-tries (WIFI_FAIL_BIT). The bits are set by event_handler() (see above) *//******************** 输出wifi连接结果 ********************/EventBits_t bits = xEventGroupWaitBits(s_wifi_event_group,WIFI_CONNECTED_BIT | WIFI_FAIL_BIT,pdFALSE,pdFALSE,portMAX_DELAY);/* xEventGroupWaitBits() returns the bits before the call returned, hence we can test which event actually* happened. */if (bits & WIFI_CONNECTED_BIT){ESP_LOGI(TAG, "connected to ap SSID:%s password:%s",EXAMPLE_ESP_WIFI_SSID, EXAMPLE_ESP_WIFI_PASS);}else if (bits & WIFI_FAIL_BIT){ESP_LOGI(TAG, "Failed to connect to SSID:%s, password:%s",EXAMPLE_ESP_WIFI_SSID, EXAMPLE_ESP_WIFI_PASS);}else{ESP_LOGE(TAG, "UNEXPECTED EVENT");}/* The event will not be processed after unregister */// 05 事件注销ESP_ERROR_CHECK(esp_event_handler_instance_unregister(IP_EVENT, IP_EVENT_STA_GOT_IP, instance_got_ip));ESP_ERROR_CHECK(esp_event_handler_instance_unregister(WIFI_EVENT, ESP_EVENT_ANY_ID, instance_any_id));vEventGroupDelete(s_wifi_event_group);
}static void esp_initialize_sntp(void)
{ESP_LOGI("esp32idf_title", "Initializing SNTP");sntp_setoperatingmode(SNTP_OPMODE_POLL);sntp_setservername(0, "ntp1.aliyun.com");sntp_setservername(1, "cn.ntp.org.cn"); // 设置访问服务器sntp_setservername(2, "pool.ntp.org");sntp_setservername(3, "210.72.145.44"); // 国家授时中心服务器 IP 地址sntp_init();
}
int get_sys_time_ms(void)
{struct timeval tv_now;gettimeofday(&tv_now, NULL);int64_t time_us = (int64_t)tv_now.tv_sec * 1000000L + (int64_t)tv_now.tv_usec;return (int)(time_us / 1000);
}void time_sync_notification_cb(struct timeval *tv)
{ESP_LOGI(TAG, "Notification of a time synchronization event");
}void user_sntp_init(void)
{char strftime_buf[64];time_t now;struct tm timeinfo;time(&now); //获取网络时间, 64bit的秒计数localtime_r(&now, &timeinfo); //转换成具体的时间参数// Is time set? If not, tm_year will be (1970 - 1900).if (timeinfo.tm_year < (2025 - 1900)){ESP_LOGI(TAG, "Time is not set yet. Connecting to WiFi and getting time over NTP.");obtain_time();// update 'now' variable with current timetime(&now);}// Set timezone to China Standard Timesetenv("TZ", "CST-8", 1);tzset();localtime_r(&now, &timeinfo);strftime(strftime_buf, sizeof(strftime_buf), "%c", &timeinfo);ESP_LOGI(TAG, "The current date/time in Shanghai is: %s", strftime_buf);while (1){time(&now);localtime_r(&now, &timeinfo);ESP_LOGI(TAG, "timeinfo.tm_isdst: %d", timeinfo.tm_isdst);ESP_LOGI(TAG, "timeinfo.tm_yday: %d", timeinfo.tm_yday);ESP_LOGI(TAG, "timeinfo.tm_wday: %d", timeinfo.tm_wday);ESP_LOGI(TAG, "timeinfo.tm_year: %d", timeinfo.tm_year + 1900);ESP_LOGI(TAG, "timeinfo.tm_mon: %d", timeinfo.tm_mon + 1);ESP_LOGI(TAG, "timeinfo.tm_mday: %d", timeinfo.tm_mday);ESP_LOGI(TAG, "timeinfo.tm_hour: %d", timeinfo.tm_hour);ESP_LOGI(TAG, "timeinfo.tm_min: %d", timeinfo.tm_min);ESP_LOGI(TAG, "timeinfo.tm_sec: %d", timeinfo.tm_sec);strftime(strftime_buf, sizeof(strftime_buf), "%c", &timeinfo);ESP_LOGI(TAG, "The current date/time in Shanghai is: %s", strftime_buf);vTaskDelay(1000 / portTICK_PERIOD_MS);}
}static void obtain_time(void)
{/*** NTP server address could be aquired via DHCP,* see LWIP_DHCP_GET_NTP_SRV menuconfig option*/
#ifdef LWIP_DHCP_GET_NTP_SRVsntp_servermode_dhcp(1);
#endifinitialize_sntp();// wait for time to be settime_t now = 0;struct tm timeinfo = {0};int retry = 0;const int retry_count = 10;while (sntp_get_sync_status() == SNTP_SYNC_STATUS_RESET && ++retry < retry_count){ESP_LOGI(TAG, "Waiting for system time to be set... (%d/%d)", retry, retry_count);vTaskDelay(2000 / portTICK_PERIOD_MS);}time(&now);localtime_r(&now, &timeinfo);
}static void initialize_sntp2(void)
{ESP_LOGI(TAG, "Initializing SNTP");sntp_setoperatingmode(SNTP_OPMODE_POLL);// sntp_setservername(0, "pool.ntp.org");sntp_setservername(0, "1.cn.pool.ntp.org");sntp_setservername(1, "1.hk.pool.ntp.org");sntp_setservername(2, "ntp1.aliyun.com");sntp_setservername(3, "ntp.aliyun.com");sntp_setservername(4, "cn.ntp.org.cn"); // 设置访问服务器sntp_setservername(5, "pool.ntp.org");sntp_setservername(6, "210.72.145.44"); // 国家授时中心服务器 IP 地址sntp_setservername(7, "ntp2.aliyun.com");sntp_set_time_sync_notification_cb(time_sync_notification_cb); //当sntp成功同步时间后,会有一个异步的回调通知应用做出相应更改sntp_set_sync_mode(SNTP_SYNC_MODE_IMMED);setenv("TZ", "CST-8", 1); //东八区tzset();sntp_init();
}
void convertStrToUnChar(char* str, unsigned char* UnChar)
{int i = strlen(str), j = 0, counter = 0;char c[2];unsigned int bytes[2];for (j = 0; j < i; j += 2) {if(0 == j % 2){c[0] = str[j];c[1] = str[j + 1];sscanf(c, "%02x" , &bytes[0]);UnChar[counter] = bytes[0];counter++;}}return;
}void app_main()
{Initialise();DisplayString(5, 1, show_wifi_reconnect, AR_SIZE(show_wifi_reconnect)); int mLevel = 0;int temp = 0;// esp_initialize_sntp();esp_err_t ret = nvs_flash_init();if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND){ESP_ERROR_CHECK(nvs_flash_erase());ret = nvs_flash_init();}ESP_ERROR_CHECK(ret);// 连wifiESP_LOGI(TAG, "ESP_WIFI_MODE_STA");wifi_init_sta();initialize_sntp2();gpio_set_direction(16, GPIO_MODE_INPUT);gpio_set_direction(2, GPIO_MODE_OUTPUT);gpio_set_pull_mode(16, GPIO_PULLUP_ONLY);gpio_get_level(16);int sync_state = sntp_get_sync_status();DrawFullScreen(nPianWoFish);DrawFullScreen(logo0);// CLEAR();int clear_counter = 0;while (true){char ori_str[]="1970-01-01";// if (mLevel != (temp = gpio_get_level(16))){temp = gpio_get_level(16);// mLevel = temp;if (temp){printf("HIGH Level\n");gpio_set_level(2, 0);}else{gpio_set_level(2, 1);printf("LOW Level\n");}}// usleep(1000 * 1000 * 1); //微秒,1000微秒=1毫秒,1000毫秒=1秒// vTaskDelay(1000/portTICK_PERIOD_MS);time_t timer; // time_t就是long int 类型// struct tm *timeinfo;struct tm timeinfo;timer = time(NULL);// tblock = localtime(&timer);// printf("Local time is: %s,sync state:%d\n", asctime(tblock), sync_state);// ESP_LOGI(TAG, "Initializing SNTP");localtime_r(&timer, &timeinfo); // 转换成具体的时间参数ESP_LOGI(TAG, "%4d-%02d-%02d %02d:%02d:%02d week:%d", timeinfo.tm_year + 1900, timeinfo.tm_mon + 1,timeinfo.tm_mday, timeinfo.tm_hour, timeinfo.tm_min, timeinfo.tm_sec, timeinfo.tm_wday);char str2date[30];char str2time[30];unsigned char date3[30];unsigned char time3[30];//sprintf(str2, "%4d-%02d-%02d %02d:%02d:%02d week:%d", timeinfo.tm_year + 1900, timeinfo.tm_mon + 1,//timeinfo.tm_mday, timeinfo.tm_hour, timeinfo.tm_min, timeinfo.tm_sec, timeinfo.tm_wday);sprintf(str2date, "%4d-%02d-%02d", timeinfo.tm_year + 1900, timeinfo.tm_mon + 1,timeinfo.tm_mday);sprintf(str2time, "%02d:%02d:%02d", timeinfo.tm_hour, timeinfo.tm_min, timeinfo.tm_sec);for(int i=0;i<20;i++){date3[i]=(unsigned char)str2date[i]; time3[i]=(unsigned char)str2time[i]; }// CLEAR();if(strcmp(str2date,ori_str)==0)//相等说明数据没有更新,需要主动去同步{//CLEAR();printf("strcmp is 0, equal,str2date:%s,ori_str:%s,str2time:%s\n",str2date,ori_str,str2time);sntp_stop(); sntp_init(); //调用sntp_init()会立刻请求服务器同步一次时间。usleep(1000 * 1000 * 10); continue; }else {if(clear_counter==0){CLEAR();clear_counter = 1;}printf("not equal,str2date:%s,ori_str:%s\n",str2date,ori_str);}printf("str2:%s %s\n", str2date,str2time); // 输出:// printf("str3:%s\n",str3);// DrawFullScreen(nPianWoFish);// usleep(1000 * 1000 * 2);// CLEAR();// DisplayString(0, 2, show1, AR_SIZE(show1));// usleep(1000 * 1000 * 2);// CLEAR();// DrawFullScreen(hmosLogo);// usleep(1000*1000*2);// CLEAR();// DrawFullScreen(logo0);//usleep(1000 * 1000 * 2);// CLEAR();DisplayString(0, 2, show1, AR_SIZE(show1)); //第一行第三格开始// DisplayString(1,2,show_hm,AR_SIZE(show_hm));//第一行第三格开始DisplayString(1, 1, date3, 10); DisplayString(2, 1, time3, 10); // DisplayString(2, 1, show_we_chat1, AR_SIZE(show_we_chat1)); //第一行第三格开始DisplayString(3, 2, show_nick1, AR_SIZE(show_nick1)); //usleep(1000 * 1000 * 1); //微秒,1000微秒=1毫秒,1000毫秒=1秒}
}
包含的头文件:
#include "driver/gpio.h"
#include <stdio.h>
#include "unistd.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/event_groups.h"
#include <stddef.h>
#include <time.h>#include <string.h>
#include <time.h>
#include <sys/time.h>
#include "esp_system.h"
#include "esp_event.h"
#include "esp_log.h"
#include "esp_attr.h"
#include "esp_sleep.h"
#include "nvs_flash.h"
#include "esp_sntp.h"
#include "esp_wifi.h"
#include "lcd12864st7920idf.h"
lcd12864st7920idf.c ——LCD屏幕初始化:
void Initialise()
{IOT_GPIO_VALUE00 = 0;IOT_GPIO_VALUE11 = 1;gpio_set_direction(lcd_rs, GPIO_MODE_OUTPUT); //gpio_set_direction(lcd_sclk, GPIO_MODE_OUTPUT);gpio_set_direction(lcd_sid, GPIO_MODE_OUTPUT); //// digitalWrite(latchPin, LOW);gpio_set_level(lcd_rs, IOT_GPIO_VALUE00);// delayns();delay_ms(10);WriteCommand(0x30); //功能设定控制字WriteCommand(0x0c); //显示开关控制字WriteCommand(0x01); //清除屏幕控制字WriteCommand(0x06); //进入设定点控制字
}
效果:
第13篇:ESP32 idf wifi联网使用SNTP同步网络时间LCD显示
项目工程代码:
待更新:...