Kitchen environment monitoring system based on STM32

Foreword        

        This article integrates all previous articles and is a comprehensive version of the previous articles.

MQ-2 smoke sensor module function implementation (STM32)

MQ-7 carbon monoxide sensor module function implementation (STM32)

dht11 temperature and humidity module function implementation (STM32)

0.96-inch 4-pin OLED screen module function implementation (STM32)

Button modification threshold function, alarm function, air quality function implementation (STM32)

ESP8266 communicates with mobile app (STM32)

demand analysis    

        ​ ​ Requirements Overview

        According to actual needs, this system has three main functions: First, each module of the 32 microcontroller can work normally and can correctly monitor parameters such as air quality, smoke concentration, CO concentration, temperature and humidity in the kitchen, and transmit these environmental parameters. to the OLED screen for display. Secondly, the system needs to be able to trigger an alarm mechanism based on changes in environmental parameters, such as triggering an alarm when the air quality level is poor or triggering an alarm when the temperature exceeds a set threshold. Finally, this system needs to be able to adjust the set high and low temperatures through buttons, and set environmental parameter thresholds through the mobile APP; it also needs to be able to send environmental data to the mobile APP via Wi-Fi, and can remotely monitor the kitchen through the APP Environmental changes, and setting environmental parameter thresholds.

        Overall operation process

        First, collect environmental parameter data, including smoke concentration, CO concentration, temperature and humidity, and then evaluate the air quality based on these parameters; second, transmit the data to the OLED screen for display, and trigger the corresponding alarm mechanism; third, Adjust the set high and low temperatures by pressing the buttons and set the environmental parameter thresholds; fourth, send the environmental data to the mobile APP through Wi-Fi for remote monitoring, and set the environmental parameter thresholds through the APP. The overall operation flow diagram is shown in the figure:

Schematic diagram of the overall operation process

         Functional Requirements

        Environmental parameter collection: The system needs to be able to correctly collect parameter data such as smoke concentration, CO concentration, temperature and humidity, and make correct judgments on air quality.

        Data display: The system needs to be able to display the monitored environmental data through the OLED screen.

        ​​​​Alarm mechanism: The system needs to be able to trigger an alarm mechanism based on changes in environmental parameters. For example, an alarm is triggered when the air quality level is poor, and an alarm is triggered when the temperature exceeds a set threshold.

        Button adjustment settings: The system needs to be able to adjust the set high and low temperatures through buttons, and set environmental parameter thresholds through the mobile APP.

        Remote monitoring: The system needs to be able to send environmental data to a mobile APP through Wi-Fi, and can remotely monitor environmental changes in the kitchen through the APP, and set environmental parameter thresholds.

        System reliability: The system needs to ensure stable operation over a long period of time and have certain anti-interference capabilities.

        ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ do​ not not not not not not cheest d'état, the system need to be simple and easy to use, and provide a clear operating interface, so that users can easily operate and set up the system.

        Non-functional requirements

        Performance requirements: The system needs to have sufficient performance to be able to quickly process and display data while monitoring environmental parameters in real time.

        Reliability requirements: The system needs to ensure high reliability so that it will not malfunction during long-term operation.

        Maintainability requirements: The system needs to be easily maintained and repaired so that faults can be solved or the system can be upgraded in a timely manner.

        Ease of use requirements: The system needs to provide a simple and easy-to-use operating interface so that users can easily set up and operate the system.

        Scalability requirements: The system needs to have certain scalability so that new monitoring parameters or functions can be added as needed in the future.

        Power consumption requirements: The system needs to ensure low power consumption in order to save energy and extend the service life of the system.

        ​ ​ ​Response time requirements: The system needs to ensure that the alarm mechanism can be triggered in time when abnormal conditions are detected, so that corresponding measures can be taken in a timely manner.

Function realization      

        Smoke sensor function implementation

        The selected smoke sensor MQ-2 smoke sensor is a tin dioxide semiconductor gas-sensitive material and a surface ion N-type semiconductor. When at 200~300 degrees Celsius, tin dioxide adsorbs oxygen in the air, forming negative ion adsorption of oxygen, which reduces the electron density in the semiconductor, thereby increasing its resistance value. When in contact with smoke, if the potential barrier at the grain boundary changes due to the smoke, it will cause changes in surface conductivity. This can be used to obtain information about the existence of this smoke. The greater the concentration of smoke, the greater the conductivity, and the lower the output resistance, the greater the output analog signal.

        This topic uses the MQ-2 sensor to monitor the concentration of CH4. The 32 microcontroller can read the analog voltage signal output by the MQ-2 sensor through the ADC (analog-to-digital converter). First, you can first obtain the average value of the ADC within a certain period of time. Secondly, you can use the formula to convert the average value of the ADC into the output voltage value of MQ-2. Then, according to this voltage signal and the sensor characteristic curve (i.e., the yellow in the figure above Triangular polyline) to calculate the concentration of CH4. For example, define the Smog_Get_Vol() function to read the voltage value of the MQ-2 sensor. It uses the STM32 ADC module to obtain analog signals and convert them into digital values. Next, the function converts the analog voltage value to a digital value and divides it by 4096.0 to obtain a voltage value in the range of 0 to 3.3V. Finally, the function returns a voltage value that is proportional to the concentration of CH4. Then define the Smog_GetPPM() function to calculate the CH4 concentration detected by the MQ-2 sensor. In this function, first obtain the voltage value of the MQ-2 sensor by calling the Smog_Get_Vol() function. Then, calculate the resistance value (RS) of the MQ-2 sensor, which is based on the voltage value of the sensor and the resistance value in the circuit. Here, the resistance value (RL) in the circuit and the resistance value (R0) of the MQ-2 sensor at the CH4 concentration in the air are predetermined constants. Finally, the function calculates the concentration of CH4 in ppm and returns that value.

        MQ2.c

#include "mq2.h"

#define CAL_PPM  10  // 校准环境中PPM值
#define RL	     10  // RL阻值
#define R0	     26  // R0阻值


void MQ2_Init(void)
{
	GPIO_InitTypeDef      GPIO_InitStructure;
	ADC_CommonInitTypeDef ADC_CommonInitStructure;
	ADC_InitTypeDef       ADC_InitStructure;
	
	/* 引脚和ADC的时钟使能 */
	RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);  
	RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1, ENABLE);

	/* 配置引脚为模拟功能模式 */
	GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4;
	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AN;		//模拟功能模式
	GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL ;
	GPIO_Init(GPIOA, &GPIO_InitStructure);
	
	/* ADC的常规配置 */
	ADC_CommonInitStructure.ADC_Mode = ADC_Mode_Independent;		//独立模式
	ADC_CommonInitStructure.ADC_Prescaler = ADC_Prescaler_Div2;		//84MHz/2 = 42MHz
	ADC_CommonInitStructure.ADC_DMAAccessMode = ADC_DMAAccessMode_Disabled;	//禁止MDA
	ADC_CommonInitStructure.ADC_TwoSamplingDelay = ADC_TwoSamplingDelay_5Cycles;	//ADC通道采用间隔
	ADC_CommonInit(&ADC_CommonInitStructure);

	/* ADC1 初始化 ****************************************************************/
	ADC_InitStructure.ADC_Resolution = ADC_Resolution_12b;		//分辨率
	ADC_InitStructure.ADC_ScanConvMode = DISABLE;				//禁止扫描			
	ADC_InitStructure.ADC_ContinuousConvMode = ENABLE;			//连续转换模式
	ADC_InitStructure.ADC_ExternalTrigConvEdge = ADC_ExternalTrigConvEdge_None;//不需要外部触发
	ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right;		//数据右对齐
	ADC_InitStructure.ADC_NbrOfConversion = 1;					//一次转换
	ADC_Init(ADC1, &ADC_InitStructure);
	
	//ADC1的采样通道4放入规则通道1中
	ADC_RegularChannelConfig(ADC1, ADC_Channel_4, 1, ADC_SampleTime_3Cycles);

	/* 使能 ADC1 */
	ADC_Cmd(ADC1, ENABLE);
}

uint32_t MQ2_ADC_Read(void)
{
	/* 启动软件触发检测 */ 
	ADC_SoftwareStartConv(ADC1);
	
	//等待转换结束
	while( ADC_GetFlagStatus(ADC1, ADC_FLAG_EOC) == RESET);
	
	return ADC_GetConversionValue(ADC1);
}

//计算平均值
u16 ADC1_Average_Data(u8 ADC_Channel)
{
	u16 temp_val=0;
	u8 t;
	for(t=0;t<SMOG_READ_TIMES;t++)	//#define SMOG_READ_TIMES	10	定义烟雾传感器读取次数,读这么多次,然后取平均值

	{
		temp_val+=MQ2_ADC_Read();	//读取ADC值
		delay_ms(5);
	}
	temp_val/=SMOG_READ_TIMES;//得到平均值
    return (u16)temp_val;//返回算出的ADC平均值
}

//读取MQ7传感器的电压值
float Smog_Get_Vol(void)
{
	u16 adc_value = 0;//这是从MQ-7传感器模块电压输出的ADC转换中获得的原始数字值,该值的范围为0到4095,将模拟电压表示为数字值
	float voltage = 0;//MQ-7传感器模块的电压输出,与一氧化碳的浓度成正比
	
	adc_value = ADC1_Average_Data(ADC_Channel_4);//#define SMOG_ADC_CHX	ADC_Channel_4	定义烟雾传感器所在的ADC通道编号
	delay_ms(5);
	
    voltage  = (3.3/4096.0)*(adc_value);
	
	return voltage;
}
/*********************
// 传感器校准函数,根据当前环境PPM值与测得的RS电压值,反推出R0值,在空气中运行过后测出R0为26
float MQ7_PPM_Calibration()
{
	float RS = 0;
	float R0 = 0;
	RS = (3.3f - Smog_Get_Vol()) / Smog_Get_Vol() * RL;//RL	10  // RL阻值
	R0 = RS / pow(CAL_PPM / 98.322, 1 / -1.458f);//CAL_PPM  10  // 校准环境中PPM值
	return R0;
}
**********************/

// 计算Smog_ppm
float Smog_GetPPM()
{
	float RS = (3.3f - Smog_Get_Vol()) / Smog_Get_Vol() * RL;
	float ppm = 98.322f * pow(RS/R0, -1.458f);
	return  ppm;
}

        mq2.h

#ifndef _MQ2_H
#define _MQ2_H

//C文件中需要的其他的头文件
#include <stm32f4xx.h>
#include "sys.h"
#include "delay.h"
#include "math.h"

#define SMOG_READ_TIMES	10				//定义烟雾传感器读取次数,读这么多次,然后取平均值


//C文件中定义的函数的声明
void MQ2_Init(void);
float Smog_Get_Vol(void);	//读取MQ7传感器的电压值
//float MQ7_PPM_Calibration(void);
float Smog_GetPPM(void);


#endif

        ​​​​CO sensor module function implementation

        The selected CO sensor MQ-7 is also a semiconductor-based smoke sensor, consisting of a miniature AL2O3 ceramic tube, a tin dioxide (SnO2) sensitive layer, a measuring electrode and a heater. Its working principle is consistent with the above-mentioned MQ-2 sensor. It is based on chemical reactions and electrical signal conversion.

        There is a small heater inside the MQ-7 smoke sensor. It is heated by current, which increases the temperature of the sensor's working environment and accelerates the movement of gas molecules. When organic compounds such as smoke and gas are present in the air, these compounds will react chemically on the heater and release some gases, such as carbon dioxide, carbon monoxide, etc. These gases will enter the sensitive element inside the sensor and react chemically with oxygen, causing the resistance of the sensitive element to change. When the concentration of CO in the air increases, the resistance decreases, thus outputting an analog signal. The 32 microcontroller reads the analog voltage signal output by the sensor through an analog-to-digital converter (ADC), and converts the voltage value into a carbon monoxide concentration value according to the sensor characteristic curve function. The specific steps are: first, obtain the average value of the ADC within a certain period of time, secondly, use the formula to convert the average value of the ADC into the output voltage value of the MQ-7, and then calculate the concentration of CO based on this voltage signal and the sensor characteristic curve. Since the principle of MQ-7 is similar to the above-mentioned MQ-2, no detailed explanation will be given here.

        MQ7.c

#include "mq7.h"

#define CAL_PPM  10  // 校准环境中PPM值
#define RL	     10  // RL阻值
#define R0	     16  // R0阻值

u16 MQ7_Buffer[4];

void CO_Init(void)
{
	GPIO_InitTypeDef GPIO_InitStructure;
	
	RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA,ENABLE);//使能PA的时钟
	
	GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;			//PA6 模拟输入引脚
	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AN;		//输入模式
	GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;		//上下拉电阻:无上下拉电阻
	GPIO_Init(GPIOA, &GPIO_InitStructure);
	
	adc_Init();
}

//计算平均值
u16 ADC2_Average_Data(u8 ADC_Channel)
{
	u16 temp_val=0;
	u8 t;
	for(t=0;t<CO_READ_TIMES;t++)	//#define CO_READ_TIMES	10	定义烟雾传感器读取次数,读这么多次,然后取平均值

	{
		temp_val+=ADC_Read();	//读取ADC值
		delay_ms(5);
	}
	temp_val/=CO_READ_TIMES;//得到平均值
    return (u16)temp_val;//返回算出的ADC平均值
}

//float voltage = adc_value * (3.3 / 4096.0);  将ADC值转换为电压

/***********************************
		计算Rs的两种公式
float Rs = (3.3 * RL) / voltage - RL; 计算传感器的电阻  RL:负载电阻阻值
float RS = (3.3f - voltage) / voltage * RL;
************************************/

//float co_ppm = a * pow(Rs/R0, b); 使用校准曲线计算一氧化碳浓度
//a, b是MQ-7传感器模块校准曲线的系数.其值来源于MQ7的手册资料,a = 98.322, b = -1.458
//R0是器件在洁净空气中的电阻值,来自于MQ-7灵敏度特性曲线,R0 = RS / pow(CAL_PPM / 98.322, 1 / -1.458f);

//读取MQ7传感器的电压值
float CO_Get_Vol()
{
	u16 adc_value = 0;//这是从MQ-7传感器模块电压输出的ADC转换中获得的原始数字值,该值的范围为0到4095,将模拟电压表示为数字值
	float voltage = 0;//MQ-7传感器模块的电压输出,与一氧化碳的浓度成正比
	
	adc_value = ADC2_Average_Data(ADC_Channel_6);
	delay_ms(5);
	
    voltage  = (3.3/4096.0)*(adc_value);
	
	return voltage;
}

/*********************
// 传感器校准函数,根据当前环境PPM值与测得的RS电压值,反推出R0值,在空气中运行过后测出R0为16
float MQ7_PPM_Calibration()
{
	float RS = 0;
	float R0 = 0;
	RS = (3.3f - Smog_Get_Vol()) / Smog_Get_Vol() * RL;//RL	10  // RL阻值
	R0 = RS / pow(CAL_PPM / 98.322, 1 / -1.458f);//CAL_PPM  10  // 校准环境中PPM值
	return R0;
}
**********************/


// 计算CO_ppm
float MQ7_GetPPM()
{
	float RS = (3.3f - CO_Get_Vol()) / CO_Get_Vol() * RL;
	float ppm = 98.322f * pow(RS/R0, -1.458f);
	return  ppm;
}

        adc.c 

#include "adc.h"

void adc_Init()
{
    GPIO_InitTypeDef GPIO_InitStructure;
	ADC_CommonInitTypeDef ADC_CommonInitStructure;
    ADC_InitTypeDef ADC_InitStructure;

    // 使能 ADC 引脚的 GPIO 时钟
    RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);

    // 将 ADC 引脚配置为模拟输入
    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;
    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AN;
    GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL ;
    GPIO_Init(GPIOA, &GPIO_InitStructure);

    // 使能 ADC2 时钟
    RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC2, ENABLE);
	
	/* ADC的常规配置 */
	ADC_CommonInitStructure.ADC_Mode = ADC_Mode_Independent;		//独立模式
	ADC_CommonInitStructure.ADC_Prescaler = ADC_Prescaler_Div2;		//84MHZ/2 = 42MHZ
	ADC_CommonInitStructure.ADC_DMAAccessMode = ADC_DMAAccessMode_Disabled;	//禁止MDA
	ADC_CommonInitStructure.ADC_TwoSamplingDelay = ADC_TwoSamplingDelay_5Cycles;	//ADC通道采用间隔
	ADC_CommonInit(&ADC_CommonInitStructure);

    // ADC初始化
    ADC_InitStructure.ADC_Resolution = ADC_Resolution_12b;//分辨率
    ADC_InitStructure.ADC_ScanConvMode = DISABLE;//禁止扫描	
    ADC_InitStructure.ADC_ContinuousConvMode = ENABLE;//连续转换模式
    ADC_InitStructure.ADC_ExternalTrigConvEdge = ADC_ExternalTrigConvEdge_None;//不需要外部触发
    ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right;//数据右对齐
    ADC_InitStructure.ADC_NbrOfConversion = 1;//一次转换
    ADC_Init(ADC2, &ADC_InitStructure);

    //ADC2的采样通道6放入规则通道1中
    ADC_RegularChannelConfig(ADC2, ADC_Channel_6, 1, ADC_SampleTime_3Cycles);

    // 使能 ADC2
    ADC_Cmd(ADC2, ENABLE);

    // 初始化 ADC2
    ADC_SoftwareStartConv(ADC2);
}


//获得 ADC 值
uint16_t ADC_Read(void)
{
    // 开始转换
    ADC_SoftwareStartConv(ADC2);

    // 等到转换完成
    while (ADC_GetFlagStatus(ADC2, ADC_FLAG_EOC) == RESET);

    // 获取转换结果
    return ADC_GetConversionValue(ADC2);
}

        mq7.h

#ifndef _MQ7_H
#define _MQ7_H

//C文件中需要的其他的头文件
#include <stm32f4xx.h>
#include "sys.h"
#include "delay.h"
#include "math.h"
#include "adc.h"

#define SMOG_PIN46_R	1000			//烟雾传感器管脚4、6接出到地的电阻值
#define CO_READ_TIMES	10				//定义CO传感器读取次数,读这么多次,然后取平均值

//C文件中定义的函数的声明
void CO_Init(void);
u16 ADC2_Average_Data(u8 ADC_Channel);
float CO_Get_Vol(void);
//float MQ7_PPM_Calibration();
float MQ7_GetPPM(void);

#endif

        adc.h

#ifndef _ADC_H
#define _ADC_H

//C文件中需要的其他的头文件
#include <stm32f4xx.h>
#include "sys.h"
#include "delay.h"


//C文件中定义的函数的声明
void adc_Init(void);
uint16_t ADC_Read(void);

#endif

        Temperature and humidity module function implementation 

        DTH11 integrates a temperature and humidity sensor module and a digital signal processing circuit, which can convert temperature and humidity values ​​into digital signal output. The digital signal output format is a binary number, including 40-bit data, including 8-bit humidity integer data, 8-bit humidity decimal data, 8-bit temperature integer data, 8-bit temperature decimal data and an 8-bit checksum. By reading the digital signal output by DTH11, STM32 can obtain accurate values ​​of temperature and humidity, and then control the environment.

        The STM32 microcontroller is connected to the dth11 sensor through pins, including VCC, GND, and DATA pins. The microcontroller sends a start signal to the dth11 sensor, that is, pulls the DATA pin low for at least 18ms, and then pulls the DATA pin high again, waiting for the response of the dth11 sensor. At this time, the dth11 sensor will send an 80us low-level response signal, and then send an 80us high-level signal, indicating that it is ready to send data. Then, the dth11 sensor begins to send 40-bit binary data to the microcontroller, including humidity value, temperature value, check digit and other information. Each bit of data has a fixed sending method, that is: first, the dth11 sensor will pull the DATA pin low for 50us, indicating that it starts to send one bit of data; secondly, the dth11 sensor will pull the DATA pin high for 26~28us based on the actual value. It means 0, or pulling it high for 70us means 1; finally, the microcontroller needs to pull the DATA pin high after each bit of data is sent, waiting for the next bit of data to be sent. When the microcontroller receives the 40-bit data, it needs to parse the data to obtain the temperature and humidity values, as well as the check digit information.

        In actual operation, you can define a dht11_read_data() function to read temperature and humidity data from the DHT11 sensor. This function first starts the DHT11 sensor by calling the dht11_start() function and waits for its response. If the DHT11 sensor does not respond within 100 times, the function returns -1 indicating startup failure. Next, the function reads 5 bytes of data by calling the dht11_readbyte() function, where the first two bytes are humidity data, the next two bytes are temperature data, and the last byte is the checksum. Finally, the function calculates the checksum, and if the checksum does not match, the function returns -2 to indicate that the data read failed. If everything is normal, the function returns 0 and the read humidity and temperature data are stored in the input buffer (buf).

        DHT11.c

#include "DHT11.h"

void dht11_outputmode(void)
{
	GPIO_InitTypeDef GPIO_InitStructure;
	
	//初始化DHT11对应的引脚 PG9 的时钟
	RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOG, ENABLE);
	
	//2、通过结构体初始化DHT11引脚
	/* 配置PG9 引脚为输出模式 */
	GPIO_InitStructure.GPIO_Pin 	= GPIO_Pin_9;			//配置的引脚
	GPIO_InitStructure.GPIO_Mode 	= GPIO_Mode_OUT;		//输出模式
	GPIO_InitStructure.GPIO_OType 	= GPIO_OType_PP;		//推挽模式
	GPIO_InitStructure.GPIO_Speed 	= GPIO_Speed_100MHz;	//速度为100MHz
	GPIO_InitStructure.GPIO_PuPd 	= GPIO_PuPd_NOPULL;		//上下拉电阻:无上下拉电阻
	GPIO_Init(GPIOG, &GPIO_InitStructure);

}

void dht11_inputmode(void)
{
	GPIO_InitTypeDef GPIO_InitStructure;
	
	//初始化DHT11对应的引脚 PG9 的时钟
	RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOG, ENABLE);
	
	//2、通过结构体初始化DHT11引脚
	/* 配置PG9 引脚为输出模式 */
	GPIO_InitStructure.GPIO_Pin 	= GPIO_Pin_9;			//配置的引脚
	GPIO_InitStructure.GPIO_Mode 	= GPIO_Mode_IN;			//输入模式
	GPIO_InitStructure.GPIO_OType 	= GPIO_OType_PP;		//推挽模式
	GPIO_InitStructure.GPIO_Speed 	= GPIO_Speed_100MHz;	//速度为100MHz
	GPIO_InitStructure.GPIO_PuPd 	= GPIO_PuPd_NOPULL;		//上下拉电阻:无上下拉电阻
	GPIO_Init(GPIOG, &GPIO_InitStructure);

}

//发送开始信号和接收响应信号
uint32_t dht11_start(void)
{
	uint32_t i;
	/* 发送开始信号 */
	//配置PG9位输出模式
	dht11_outputmode();
	
	//引脚输出低电平
	PGout(9) = 0;
	delay_ms(20);

	//引脚输出高电平
	PGout(9) = 1;
	delay_us(30);
	
	/* 接收响应信号 */ 
	//配置PG9位输入模式
	dht11_inputmode();
	
	//检测低电平,最多持续100us
	i=0;
	while(i<100)
	{
		//检测到低电平跳出循环
		if(PGin(9) == 0)
			break;
		
		i++;
		delay_us(1);
	}
	
	if(i>=100)	//上面的循环是超时跳出,对方无响应
		return 1;
		
	//检测高电平,最多持续100us
	i=0;
	while(i<100)
	{
		//检测到高电平跳出循环
		if(PGin(9))
			break;
		
		i++;
		delay_us(1);
	}
	
	if(i>=100)	//上面的循环是超时跳出,对方无响应
		return 2;

	return 0;
}

uint8_t dht11_readbyte(void)
{
	int i;
	uint8_t d=0;
	
	//跳过前面的高电平
	while(PGin(9));
	
	for(i=0; i<8; i++)
	{
		//跳过前面50us低电平
		while(PGin(9)==0);
		
		delay_us(40);
		
		if(PGin(9))	//引脚为高电平,说明数据为1
		{
			d |= 1<<(7-i);//保存数据
		
			while(PGin(9));	//跳过剩余的高电平时间
		}
	}
	
	return d;
}

int dht11_read_data(uint8_t *buf)
{

	//让DHT11启动
	int i=0;
	while(i<100)
	{
		//启动成功,跳出循环
		if(dht11_start() == 0)
			break;
		
		i++;
		delay_us(1);
	}
	if(i>=100)//上面循环是由于超时退出,DHT11没有启动
		return -1;
	
	//读取5字节数据
	for(i=0; i<5; i++)
	{
		buf[i] = dht11_readbyte();
	}
	
	//计算检验和
	if(buf[4] != buf[0]+buf[1]+buf[2]+buf[3])
		return -2;

	return 0;

}

        DHT11.h

#ifndef _DHT11_H
#define _DHT11_H

//C文件中需要的其他的头文件
#include <stm32f4xx.h>
#include "sys.h"
#include "delay.h"


//C文件中定义的函数的声明
int dht11_read_data(uint8_t *buf);

#endif

        OLED module function implementation

        When using a 0.96-inch 4-pin OLED screen module in a 32 microcontroller, it is necessary to convert the output signal of the microcontroller into a signal that can be recognized by the OLED screen. Therefore, it is necessary to use a corresponding OLED controller to communicate through the I2C bus to convert the output signal of the microcontroller into a signal that can be recognized by the OLED screen. The driver function of the OLED screen module should be defined in the code. The driver of the OLED screen module mainly includes the following parts: write function (used to send commands or data to the OLED), clear screen function (used to clear all content on the OLED ), display function (used to write the content in the buffer to OLED), function to light up or turn off pixels, function to display characters or strings, etc. Finally, initialize the OLED screen module. The specific steps are: first turn on the clock of GPIOB; then set pins 8 and 9 of GPIOB to output mode, push-pull output, 100MHz rate, pull-up; delay 200ms, wait for the OLED screen to start; send OLED Initialization command sequence; finally clear the OLED screen. Since the environmental parameters change, you can consider converting the environmental parameter variables and environmental thresholds into string forms and then output them on the OLED screen.

        you are.c

#include "oled.h"
#include "stdlib.h"
#include "oledfont.h"  	 


u8 OLED_GRAM[144][8];

void delay(u32 t)
{
	while(t--);
}

//反显函数
void OLED_ColorTurn(u8 i)
{
	if(i==0)
		{
			OLED_WR_Byte(0xA6,OLED_CMD);//正常显示
		}
	if(i==1)
		{
			OLED_WR_Byte(0xA7,OLED_CMD);//反色显示
		}
}

//屏幕旋转180度
void OLED_DisplayTurn(u8 i)
{
	if(i==0)
		{
			OLED_WR_Byte(0xC8,OLED_CMD);//正常显示
			OLED_WR_Byte(0xA1,OLED_CMD);
		}
	if(i==1)
		{
			OLED_WR_Byte(0xC0,OLED_CMD);//反转显示
			OLED_WR_Byte(0xA0,OLED_CMD);
		}
}

//起始信号
void I2C_Start(void)
{
	OLED_SDIN_Set();delay(1);
	OLED_SCLK_Set();delay(1);
	OLED_SDIN_Clr();delay(1);
	OLED_SCLK_Clr();delay(1);
}

//结束信号
void I2C_Stop(void)
{
	OLED_SCLK_Set();delay(1);
	OLED_SDIN_Clr();delay(1);
	OLED_SDIN_Set();delay(1);
}

//等待信号响应
void I2C_WaitAck(void) //测数据信号的电平
{
	OLED_SCLK_Set();delay(1);
	OLED_SCLK_Clr();delay(1);
}

//写入一个字节
void Send_Byte(u8 dat)
{
	u8 i;
	for(i=0;i<8;i++)
	{
		OLED_SCLK_Clr();//将时钟信号设置为低电平
		delay(1);
		if(dat&0x80)//将dat的8位从最高位依次写入
		{
			OLED_SDIN_Set();delay(1);
    }
		else
		{
			OLED_SDIN_Clr();delay(1);
    }
		OLED_SCLK_Set();//将时钟信号设置为高电平
		delay(1);
		OLED_SCLK_Clr();//将时钟信号设置为低电平
		delay(1);
		dat<<=1;
  }
}

//发送一个字节
//向SSD1306写入一个字节。
//mode:数据/命令标志 0,表示命令;1,表示数据;
void OLED_WR_Byte(u8 dat,u8 mode)
{
	I2C_Start();
	Send_Byte(0x78);
	I2C_WaitAck();
	if(mode){Send_Byte(0x40);}
	else{Send_Byte(0x00);}
	I2C_WaitAck();
	Send_Byte(dat);
	I2C_WaitAck();
	I2C_Stop();
}

//开启OLED显示 
void OLED_DisPlay_On(void)
{
	OLED_WR_Byte(0x8D,OLED_CMD);//电荷泵使能
	OLED_WR_Byte(0x14,OLED_CMD);//开启电荷泵
	OLED_WR_Byte(0xAF,OLED_CMD);//点亮屏幕
}

//关闭OLED显示 
void OLED_DisPlay_Off(void)
{
	OLED_WR_Byte(0x8D,OLED_CMD);//电荷泵使能
	OLED_WR_Byte(0x10,OLED_CMD);//关闭电荷泵
	OLED_WR_Byte(0xAF,OLED_CMD);//关闭屏幕
}

//更新显存到OLED	
void OLED_Refresh(void)
{
	u8 i,n;
	for(i=0;i<8;i++)
	{
	   OLED_WR_Byte(0xb0+i,OLED_CMD); //设置行起始地址
	   OLED_WR_Byte(0x00,OLED_CMD);   //设置低列起始地址
	   OLED_WR_Byte(0x10,OLED_CMD);   //设置高列起始地址
	   for(n=0;n<128;n++)
		 OLED_WR_Byte(OLED_GRAM[n][i],OLED_DATA);
  }
}
//清屏函数
void OLED_Clear(void)
{
	u8 i,n;
	for(i=0;i<8;i++)
	{
	   for(n=0;n<128;n++)
			{
			 OLED_GRAM[n][i]=0;//清除所有数据
			}
  }
	OLED_Refresh();//更新显示
}

//画点 
//x:0~127
//y:0~63
void OLED_DrawPoint(u8 x,u8 y)
{
	u8 i,m,n;
	i=y/8;
	m=y%8;
	n=1<<m;
	OLED_GRAM[x][i]|=n;
}

//清除一个点
//x:0~127
//y:0~63
void OLED_ClearPoint(u8 x,u8 y)
{
	u8 i,m,n;
	i=y/8;
	m=y%8;
	n=1<<m;
	OLED_GRAM[x][i]=~OLED_GRAM[x][i];
	OLED_GRAM[x][i]|=n;
	OLED_GRAM[x][i]=~OLED_GRAM[x][i];
}


//画线
//x:0~128
//y:0~64
void OLED_DrawLine(u8 x1,u8 y1,u8 x2,u8 y2)
{
	u8 i,k,k1,k2,y0;
	if((x1<0)||(x2>128)||(y1<0)||(y2>64)||(x1>x2)||(y1>y2))return;
	if(x1==x2)    //画竖线
	{
			for(i=0;i<(y2-y1);i++)
			{
				OLED_DrawPoint(x1,y1+i);
			}
  }
	else if(y1==y2)   //画横线
	{
			for(i=0;i<(x2-x1);i++)
			{
				OLED_DrawPoint(x1+i,y1);
			}
  }
	else      //画斜线
	{
		k1=y2-y1;
		k2=x2-x1;
		k=k1*10/k2;
		for(i=0;i<(x2-x1);i++)
			{
			  OLED_DrawPoint(x1+i,y1+i*k/10);
			}
	}
}
//x,y:圆心坐标
//r:圆的半径
void OLED_DrawCircle(u8 x,u8 y,u8 r)
{
	int a, b,num;
    a = 0;
    b = r;
    while(2 * b * b >= r * r)      
    {
        OLED_DrawPoint(x + a, y - b);
        OLED_DrawPoint(x - a, y - b);
        OLED_DrawPoint(x - a, y + b);
        OLED_DrawPoint(x + a, y + b);
 
        OLED_DrawPoint(x + b, y + a);
        OLED_DrawPoint(x + b, y - a);
        OLED_DrawPoint(x - b, y - a);
        OLED_DrawPoint(x - b, y + a);
        
        a++;
        num = (a * a + b * b) - r*r;//计算画的点离圆心的距离
        if(num > 0)
        {
            b--;
            a--;
        }
    }
}



//在指定位置显示一个字符,包括部分字符
//x:0~127
//y:0~63
//size:选择字体 12/16/24
//取模方式 逐列式
void OLED_ShowChar(u8 x,u8 y,u8 chr,u8 size1)
{
	u8 i,m,temp,size2,chr1;
	u8 y0=y;
	size2=(size1/8+((size1%8)?1:0))*(size1/2);  //得到字体一个字符对应点阵集所占的字节数
	chr1=chr-' ';  //计算偏移后的值
	for(i=0;i<size2;i++)
	{
		if(size1==12)
        {temp=asc2_1206[chr1][i];} //调用1206字体
		else if(size1==16)
        {temp=asc2_1608[chr1][i];} //调用1608字体
		else if(size1==24)
        {temp=asc2_2412[chr1][i];} //调用2412字体
		else return;
				for(m=0;m<8;m++)           //写入数据
				{
					if(temp&0x80)OLED_DrawPoint(x,y);
					else OLED_ClearPoint(x,y);
					temp<<=1;
					y++;
					if((y-y0)==size1)
					{
						y=y0;
						x++;
						break;
          }
				}
  }
}


//显示字符串
//x,y:起点坐标  
//size1:字体大小 
//*chr:字符串起始地址 
void OLED_ShowString(u8 x,u8 y,u8 *chr,u8 size1)
{
	while((*chr>=' ')&&(*chr<='~'))//判断是不是非法字符!
	{
		OLED_ShowChar(x,y,*chr,size1);
		x+=size1/2;
		if(x>128-size1)  //换行
		{
			x=0;
			y+=2;
    }
		chr++;
  }
}

//m^n
u32 OLED_Pow(u8 m,u8 n)
{
	u32 result=1;
	while(n--)
	{
	  result*=m;
	}
	return result;
}

显示2个数字
x,y :起点坐标	 
len :数字的位数
size:字体大小
void OLED_ShowNum(u8 x,u8 y,u32 num,u8 len,u8 size1)
{
	u8 t,temp;
	for(t=0;t<len;t++)
	{
		temp=(num/OLED_Pow(10,len-t-1))%10;
			if(temp==0)
			{
				OLED_ShowChar(x+(size1/2)*t,y,'0',size1);
      }
			else 
			{
			  OLED_ShowChar(x+(size1/2)*t,y,temp+'0',size1);
			}
  }
}

//显示汉字
//x,y:起点坐标
//num:汉字对应的序号
//取模方式 列行式
void OLED_ShowChinese(u8 x,u8 y,u8 num,u8 size1)
{
	u8 i,m,n=0,temp,chr1;
	u8 x0=x,y0=y;
	u8 size3=size1/8;
	while(size3--)
	{
		chr1=num*size1/8+n;
		n++;
			for(i=0;i<size1;i++)
			{
				if(size1==16)
						{temp=Hzk1[chr1][i];}//调用16*16字体
				else if(size1==24)
						{temp=Hzk2[chr1][i];}//调用24*24字体
				else if(size1==32)       
						{temp=Hzk3[chr1][i];}//调用32*32字体
				else if(size1==64)
						{temp=Hzk4[chr1][i];}//调用64*64字体
				else return;
							
						for(m=0;m<8;m++)
							{
								if(temp&0x01)OLED_DrawPoint(x,y);
								else OLED_ClearPoint(x,y);
								temp>>=1;
								y++;
							}
							x++;
							if((x-x0)==size1)
							{x=x0;y0=y0+8;}
							y=y0;
			 }
	}
}

//显示汉字
//x,y:起点坐标
//num:汉字对应的序号
//取模方式 列行式
void OLED_ShowChinese2(u8 x,u8 y,u8 num,u8 size1)
{
	u8 i,m,n=0,temp,chr1;
	u8 x0=x,y0=y;
	u8 size3=size1/8;
	while(size3--)
	{
		chr1=num*size1/8+n;
		n++;
			for(i=0;i<size1;i++)
			{
				if(size1==16)
						{temp=Hzk5[chr1][i];}//调用16*16字体
				else if(size1==24)
						{temp=Hzk2[chr1][i];}//调用24*24字体
				else if(size1==32)       
						{temp=Hzk3[chr1][i];}//调用32*32字体
				else if(size1==64)
						{temp=Hzk4[chr1][i];}//调用64*64字体
				else return;
							
						for(m=0;m<8;m++)
							{
								if(temp&0x01)OLED_DrawPoint(x,y);
								else OLED_ClearPoint(x,y);
								temp>>=1;
								y++;
							}
							x++;
							if((x-x0)==size1)
							{x=x0;y0=y0+8;}
							y=y0;
			 }
	}
}

//显示汉字
//x,y:起点坐标
//num:汉字对应的序号
//取模方式 列行式
void OLED_ShowChinese3(u8 x,u8 y,u8 num,u8 size1)
{
	u8 i,m,n=0,temp,chr1;
	u8 x0=x,y0=y;
	u8 size3=size1/8;
	while(size3--)
	{
		chr1=num*size1/8+n;
		n++;
			for(i=0;i<size1;i++)
			{
				if(size1==16)
						{temp=Hzk6[chr1][i];}//调用16*16字体
				else return;
							
						for(m=0;m<8;m++)
							{
								if(temp&0x01)OLED_DrawPoint(x,y);
								else OLED_ClearPoint(x,y);
								temp>>=1;
								y++;
							}
							x++;
							if((x-x0)==size1)
							{x=x0;y0=y0+8;}
							y=y0;
			 }
	}
}

//num 显示汉字的个数
//space 上一遍的尾和下一遍的头的间隔
void OLED_ScrollDisplay(u8 num,u8 space)
{
	u8 i,n,t=0,m=0,r;
	int c=161;
	while(c)
	{
		if(m==0)
		{
			OLED_ShowChinese(128,0,t,16); //写入一个汉字保存在OLED_GRAM[][]数组中
			OLED_ShowChinese(128,16,t,16); //写入一个汉字保存在OLED_GRAM[][]数组中
			OLED_ShowChinese(128,32,t,16); //写入一个汉字保存在OLED_GRAM[][]数组中
			OLED_ShowChinese(128,48,t,16); //写入一个汉字保存在OLED_GRAM[][]数组中
			t++;
		}
		if(t==num)
			{
				for(r=0;r<16*space;r++)      //显示间隔
				 {
					for(i=0;i<144;i++)
						{
							for(n=0;n<8;n++)
							{
								OLED_GRAM[i-1][n]=OLED_GRAM[i][n];
							}
						}
           OLED_Refresh();
				 }
        t=0;
      }
		m++;
		if(m==16){m=0;}
		for(i=0;i<144;i++)   //实现左移
		{
			for(n=0;n<8;n++)
			{
				OLED_GRAM[i-1][n]=OLED_GRAM[i][n];
			}
		}
		OLED_Refresh();
		c--;
		if (c==0) break;
	}
}

//配置写入数据的起始位置
void OLED_WR_BP(u8 x,u8 y)
{
	OLED_WR_Byte(0xb0+y,OLED_CMD);//设置行起始地址
	OLED_WR_Byte(((x&0xf0)>>4)|0x10,OLED_CMD);
	OLED_WR_Byte((x&0x0f),OLED_CMD);
}

//x0,y0:起点坐标
//x1,y1:终点坐标
//BMP[]:要写入的图片数组
void OLED_ShowPicture(u8 x0,u8 y0,u8 x1,u8 y1,u8 BMP[])
{
	u32 j=0;
	u8 x=0,y=0;
	if(y%8==0)y=0;
	else y+=1;
	for(y=y0;y<y1;y++)
	 {
		 OLED_WR_BP(x0,y);
		 for(x=x0;x<x1;x++)
		 {
			 OLED_WR_Byte(BMP[j],OLED_DATA);
			 j++;
     }
	 }
}
//OLED的初始化
void OLED_Init(void)
{
	GPIO_InitTypeDef  GPIO_InitStructure;

	RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB,ENABLE);//使能PORTA~E,PORTG时钟

	//GPIO初始化设置
	GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8|GPIO_Pin_9;
	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;//普通输出模式
	GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;//推挽输出
	GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;//100MHz
	GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;//上拉
	GPIO_Init(GPIOB, &GPIO_InitStructure);//初始化

	
	delay_ms(200);
	
	OLED_WR_Byte(0xAE,OLED_CMD);//--关闭OLED面板
	OLED_WR_Byte(0x00,OLED_CMD);//---设置低列地址
	OLED_WR_Byte(0x10,OLED_CMD);//---设置高列地址
	OLED_WR_Byte(0x40,OLED_CMD);//--设置起始行地址 设置映射 RAM 显示起始行 (0x00~0x3F)
	OLED_WR_Byte(0x81,OLED_CMD);//--设置对比度控制寄存器
	OLED_WR_Byte(0xCF,OLED_CMD);// 设置 SEG 输出电流亮度
	OLED_WR_Byte(0xA1,OLED_CMD);//--设置 SEG/列映射     0xa0左右反置 0xa1正常
	OLED_WR_Byte(0xC8,OLED_CMD);//设置 COM/行扫描方向   0xc0上下反置 0xc8正常
	OLED_WR_Byte(0xA6,OLED_CMD);//--设置正常显示
	OLED_WR_Byte(0xA8,OLED_CMD);//--设置复用比(1 到 64)
	OLED_WR_Byte(0x3f,OLED_CMD);//--1/64 duty
	OLED_WR_Byte(0xD3,OLED_CMD);//-设置显示偏移量 移位映射 RAM 计数器 (0x00~0x3F)
	OLED_WR_Byte(0x00,OLED_CMD);//-不抵消
	OLED_WR_Byte(0xd5,OLED_CMD);//--设置显示时钟分频比/振荡器频率
	OLED_WR_Byte(0x80,OLED_CMD);//--设置分频比,设置时钟为 100 帧/秒
	OLED_WR_Byte(0xD9,OLED_CMD);//--设置预充电期
	OLED_WR_Byte(0xF1,OLED_CMD);//将预充电设置为 15 个时钟,将放电设置为 1 个时钟
	OLED_WR_Byte(0xDA,OLED_CMD);//--设置 com 引脚硬件配置
	OLED_WR_Byte(0x12,OLED_CMD);
	OLED_WR_Byte(0xDB,OLED_CMD);//--设置 vcomh
	OLED_WR_Byte(0x40,OLED_CMD);//设置 VCOM 取消选择级别
	OLED_WR_Byte(0x20,OLED_CMD);//-设置页面寻址模式(0x00/0x01/0x02)
	OLED_WR_Byte(0x02,OLED_CMD);//
	OLED_WR_Byte(0x8D,OLED_CMD);//--设置电荷泵启用/禁用
	OLED_WR_Byte(0x14,OLED_CMD);//--设置(0x10)禁用
	OLED_WR_Byte(0xA4,OLED_CMD);// 禁用整个显示 (0xa4/0xa5)
	OLED_WR_Byte(0xA6,OLED_CMD);// 禁用反向显示 (0xa6/a7)
	OLED_WR_Byte(0xAF,OLED_CMD);
	OLED_Clear();
}

        you are.h

#ifndef __OLED_H
#define __OLED_H 

#include "sys.h"
#include "stdlib.h"	
#include "delay.h"

//-----------------OLED端口定义----------------

#define OLED_SCLK_Clr() GPIO_ResetBits(GPIOB,GPIO_Pin_8)//SCL
#define OLED_SCLK_Set() GPIO_SetBits(GPIOB,GPIO_Pin_8)

#define OLED_SDIN_Clr() GPIO_ResetBits(GPIOB,GPIO_Pin_9)//DIN
#define OLED_SDIN_Set() GPIO_SetBits(GPIOB,GPIO_Pin_9)



#define OLED_CMD  0	//写命令
#define OLED_DATA 1	//写数据
#define u8 unsigned char
#define u32 unsigned int

void OLED_ClearPoint(u8 x,u8 y);
void OLED_ColorTurn(u8 i);
void OLED_DisplayTurn(u8 i);
void I2C_Start(void);
void I2C_Stop(void);
void I2C_WaitAck(void);
void Send_Byte(u8 dat);
void OLED_WR_Byte(u8 dat,u8 cmd);
void OLED_DisPlay_On(void);
void OLED_DisPlay_Off(void);
void OLED_Refresh(void);
void OLED_Clear(void);
void OLED_DrawPoint(u8 x,u8 y);
void OLED_DrawLine(u8 x1,u8 y1,u8 x2,u8 y2);
void OLED_DrawCircle(u8 x,u8 y,u8 r);
void OLED_ShowChar(u8 x,u8 y,u8 chr,u8 size1);
void OLED_ShowString(u8 x,u8 y,u8 *chr,u8 size1);
void OLED_ShowNum(u8 x,u8 y,u32 num,u8 len,u8 size1);
void OLED_ShowChinese(u8 x,u8 y,u8 num,u8 size1);
void OLED_ShowChinese2(u8 x,u8 y,u8 num,u8 size1);
void OLED_ShowChinese3(u8 x,u8 y,u8 num,u8 size1);
void OLED_ScrollDisplay(u8 num,u8 space);
void OLED_WR_BP(u8 x,u8 y);
void OLED_ShowPicture(u8 x0,u8 y0,u8 x1,u8 y1,u8 BMP[]);
void OLED_Init(void);

#endif

        oledfont.h

#ifndef __OLEDFONT_H
#define __OLEDFONT_H

//常用ASCII表
//偏移量32
//ASCII字符集
//偏移量32
//大小:12*6
/************************************6*8的点阵************************************/
//12*12 ASCII字符集点阵
const unsigned char asc2_1206[95][12]={
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*" ",0*/
{0x00,0x00,0x00,0x00,0x3F,0x40,0x00,0x00,0x00,0x00,0x00,0x00},/*"!",1*/
{0x00,0x00,0x30,0x00,0x40,0x00,0x30,0x00,0x40,0x00,0x00,0x00},/*""",2*/
{0x09,0x00,0x0B,0xC0,0x3D,0x00,0x0B,0xC0,0x3D,0x00,0x09,0x00},/*"#",3*/
{0x18,0xC0,0x24,0x40,0x7F,0xE0,0x22,0x40,0x31,0x80,0x00,0x00},/*"$",4*/
{0x18,0x00,0x24,0xC0,0x1B,0x00,0x0D,0x80,0x32,0x40,0x01,0x80},/*"%",5*/
{0x03,0x80,0x1C,0x40,0x27,0x40,0x1C,0x80,0x07,0x40,0x00,0x40},/*"&",6*/
{0x10,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"'",7*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x80,0x20,0x40,0x40,0x20},/*"(",8*/
{0x00,0x00,0x40,0x20,0x20,0x40,0x1F,0x80,0x00,0x00,0x00,0x00},/*")",9*/
{0x09,0x00,0x06,0x00,0x1F,0x80,0x06,0x00,0x09,0x00,0x00,0x00},/*"*",10*/
{0x04,0x00,0x04,0x00,0x3F,0x80,0x04,0x00,0x04,0x00,0x00,0x00},/*"+",11*/
{0x00,0x10,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*",",12*/
{0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x00,0x00},/*"-",13*/
{0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*".",14*/
{0x00,0x20,0x01,0xC0,0x06,0x00,0x38,0x00,0x40,0x00,0x00,0x00},/*"/",15*/
{0x1F,0x80,0x20,0x40,0x20,0x40,0x20,0x40,0x1F,0x80,0x00,0x00},/*"0",16*/
{0x00,0x00,0x10,0x40,0x3F,0xC0,0x00,0x40,0x00,0x00,0x00,0x00},/*"1",17*/
{0x18,0xC0,0x21,0x40,0x22,0x40,0x24,0x40,0x18,0x40,0x00,0x00},/*"2",18*/
{0x10,0x80,0x20,0x40,0x24,0x40,0x24,0x40,0x1B,0x80,0x00,0x00},/*"3",19*/
{0x02,0x00,0x0D,0x00,0x11,0x00,0x3F,0xC0,0x01,0x40,0x00,0x00},/*"4",20*/
{0x3C,0x80,0x24,0x40,0x24,0x40,0x24,0x40,0x23,0x80,0x00,0x00},/*"5",21*/
{0x1F,0x80,0x24,0x40,0x24,0x40,0x34,0x40,0x03,0x80,0x00,0x00},/*"6",22*/
{0x30,0x00,0x20,0x00,0x27,0xC0,0x38,0x00,0x20,0x00,0x00,0x00},/*"7",23*/
{0x1B,0x80,0x24,0x40,0x24,0x40,0x24,0x40,0x1B,0x80,0x00,0x00},/*"8",24*/
{0x1C,0x00,0x22,0xC0,0x22,0x40,0x22,0x40,0x1F,0x80,0x00,0x00},/*"9",25*/
{0x00,0x00,0x00,0x00,0x08,0x40,0x00,0x00,0x00,0x00,0x00,0x00},/*":",26*/
{0x00,0x00,0x00,0x00,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00},/*";",27*/
{0x00,0x00,0x04,0x00,0x0A,0x00,0x11,0x00,0x20,0x80,0x40,0x40},/*"<",28*/
{0x09,0x00,0x09,0x00,0x09,0x00,0x09,0x00,0x09,0x00,0x00,0x00},/*"=",29*/
{0x00,0x00,0x40,0x40,0x20,0x80,0x11,0x00,0x0A,0x00,0x04,0x00},/*">",30*/
{0x18,0x00,0x20,0x00,0x23,0x40,0x24,0x00,0x18,0x00,0x00,0x00},/*"?",31*/
{0x1F,0x80,0x20,0x40,0x27,0x40,0x29,0x40,0x1F,0x40,0x00,0x00},/*"@",32*/
{0x00,0x40,0x07,0xC0,0x39,0x00,0x0F,0x00,0x01,0xC0,0x00,0x40},/*"A",33*/
{0x20,0x40,0x3F,0xC0,0x24,0x40,0x24,0x40,0x1B,0x80,0x00,0x00},/*"B",34*/
{0x1F,0x80,0x20,0x40,0x20,0x40,0x20,0x40,0x30,0x80,0x00,0x00},/*"C",35*/
{0x20,0x40,0x3F,0xC0,0x20,0x40,0x20,0x40,0x1F,0x80,0x00,0x00},/*"D",36*/
{0x20,0x40,0x3F,0xC0,0x24,0x40,0x2E,0x40,0x30,0xC0,0x00,0x00},/*"E",37*/
{0x20,0x40,0x3F,0xC0,0x24,0x40,0x2E,0x00,0x30,0x00,0x00,0x00},/*"F",38*/
{0x0F,0x00,0x10,0x80,0x20,0x40,0x22,0x40,0x33,0x80,0x02,0x00},/*"G",39*/
{0x20,0x40,0x3F,0xC0,0x04,0x00,0x04,0x00,0x3F,0xC0,0x20,0x40},/*"H",40*/
{0x20,0x40,0x20,0x40,0x3F,0xC0,0x20,0x40,0x20,0x40,0x00,0x00},/*"I",41*/
{0x00,0x60,0x20,0x20,0x20,0x20,0x3F,0xC0,0x20,0x00,0x20,0x00},/*"J",42*/
{0x20,0x40,0x3F,0xC0,0x24,0x40,0x0B,0x00,0x30,0xC0,0x20,0x40},/*"K",43*/
{0x20,0x40,0x3F,0xC0,0x20,0x40,0x00,0x40,0x00,0x40,0x00,0xC0},/*"L",44*/
{0x3F,0xC0,0x3C,0x00,0x03,0xC0,0x3C,0x00,0x3F,0xC0,0x00,0x00},/*"M",45*/
{0x20,0x40,0x3F,0xC0,0x0C,0x40,0x23,0x00,0x3F,0xC0,0x20,0x00},/*"N",46*/
{0x1F,0x80,0x20,0x40,0x20,0x40,0x20,0x40,0x1F,0x80,0x00,0x00},/*"O",47*/
{0x20,0x40,0x3F,0xC0,0x24,0x40,0x24,0x00,0x18,0x00,0x00,0x00},/*"P",48*/
{0x1F,0x80,0x21,0x40,0x21,0x40,0x20,0xE0,0x1F,0xA0,0x00,0x00},/*"Q",49*/
{0x20,0x40,0x3F,0xC0,0x24,0x40,0x26,0x00,0x19,0xC0,0x00,0x40},/*"R",50*/
{0x18,0xC0,0x24,0x40,0x24,0x40,0x22,0x40,0x31,0x80,0x00,0x00},/*"S",51*/
{0x30,0x00,0x20,0x40,0x3F,0xC0,0x20,0x40,0x30,0x00,0x00,0x00},/*"T",52*/
{0x20,0x00,0x3F,0x80,0x00,0x40,0x00,0x40,0x3F,0x80,0x20,0x00},/*"U",53*/
{0x20,0x00,0x3E,0x00,0x01,0xC0,0x07,0x00,0x38,0x00,0x20,0x00},/*"V",54*/
{0x38,0x00,0x07,0xC0,0x3C,0x00,0x07,0xC0,0x38,0x00,0x00,0x00},/*"W",55*/
{0x20,0x40,0x39,0xC0,0x06,0x00,0x39,0xC0,0x20,0x40,0x00,0x00},/*"X",56*/
{0x20,0x00,0x38,0x40,0x07,0xC0,0x38,0x40,0x20,0x00,0x00,0x00},/*"Y",57*/
{0x30,0x40,0x21,0xC0,0x26,0x40,0x38,0x40,0x20,0xC0,0x00,0x00},/*"Z",58*/
{0x00,0x00,0x00,0x00,0x7F,0xE0,0x40,0x20,0x40,0x20,0x00,0x00},/*"[",59*/
{0x00,0x00,0x70,0x00,0x0C,0x00,0x03,0x80,0x00,0x40,0x00,0x00},/*"\",60*/
{0x00,0x00,0x40,0x20,0x40,0x20,0x7F,0xE0,0x00,0x00,0x00,0x00},/*"]",61*/
{0x00,0x00,0x20,0x00,0x40,0x00,0x20,0x00,0x00,0x00,0x00,0x00},/*"^",62*/
{0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10},/*"_",63*/
{0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"`",64*/
{0x00,0x00,0x02,0x80,0x05,0x40,0x05,0x40,0x03,0xC0,0x00,0x40},/*"a",65*/
{0x20,0x00,0x3F,0xC0,0x04,0x40,0x04,0x40,0x03,0x80,0x00,0x00},/*"b",66*/
{0x00,0x00,0x03,0x80,0x04,0x40,0x04,0x40,0x06,0x40,0x00,0x00},/*"c",67*/
{0x00,0x00,0x03,0x80,0x04,0x40,0x24,0x40,0x3F,0xC0,0x00,0x40},/*"d",68*/
{0x00,0x00,0x03,0x80,0x05,0x40,0x05,0x40,0x03,0x40,0x00,0x00},/*"e",69*/
{0x00,0x00,0x04,0x40,0x1F,0xC0,0x24,0x40,0x24,0x40,0x20,0x00},/*"f",70*/
{0x00,0x00,0x02,0xE0,0x05,0x50,0x05,0x50,0x06,0x50,0x04,0x20},/*"g",71*/
{0x20,0x40,0x3F,0xC0,0x04,0x40,0x04,0x00,0x03,0xC0,0x00,0x40},/*"h",72*/
{0x00,0x00,0x04,0x40,0x27,0xC0,0x00,0x40,0x00,0x00,0x00,0x00},/*"i",73*/
{0x00,0x10,0x00,0x10,0x04,0x10,0x27,0xE0,0x00,0x00,0x00,0x00},/*"j",74*/
{0x20,0x40,0x3F,0xC0,0x01,0x40,0x07,0x00,0x04,0xC0,0x04,0x40},/*"k",75*/
{0x20,0x40,0x20,0x40,0x3F,0xC0,0x00,0x40,0x00,0x40,0x00,0x00},/*"l",76*/
{0x07,0xC0,0x04,0x00,0x07,0xC0,0x04,0x00,0x03,0xC0,0x00,0x00},/*"m",77*/
{0x04,0x40,0x07,0xC0,0x04,0x40,0x04,0x00,0x03,0xC0,0x00,0x40},/*"n",78*/
{0x00,0x00,0x03,0x80,0x04,0x40,0x04,0x40,0x03,0x80,0x00,0x00},/*"o",79*/
{0x04,0x10,0x07,0xF0,0x04,0x50,0x04,0x40,0x03,0x80,0x00,0x00},/*"p",80*/
{0x00,0x00,0x03,0x80,0x04,0x40,0x04,0x50,0x07,0xF0,0x00,0x10},/*"q",81*/
{0x04,0x40,0x07,0xC0,0x02,0x40,0x04,0x00,0x04,0x00,0x00,0x00},/*"r",82*/
{0x00,0x00,0x06,0x40,0x05,0x40,0x05,0x40,0x04,0xC0,0x00,0x00},/*"s",83*/
{0x00,0x00,0x04,0x00,0x1F,0x80,0x04,0x40,0x00,0x40,0x00,0x00},/*"t",84*/
{0x04,0x00,0x07,0x80,0x00,0x40,0x04,0x40,0x07,0xC0,0x00,0x40},/*"u",85*/
{0x04,0x00,0x07,0x00,0x04,0xC0,0x01,0x80,0x06,0x00,0x04,0x00},/*"v",86*/
{0x06,0x00,0x01,0xC0,0x07,0x00,0x01,0xC0,0x06,0x00,0x00,0x00},/*"w",87*/
{0x04,0x40,0x06,0xC0,0x01,0x00,0x06,0xC0,0x04,0x40,0x00,0x00},/*"x",88*/
{0x04,0x10,0x07,0x10,0x04,0xE0,0x01,0x80,0x06,0x00,0x04,0x00},/*"y",89*/
{0x00,0x00,0x04,0x40,0x05,0xC0,0x06,0x40,0x04,0x40,0x00,0x00},/*"z",90*/
{0x00,0x00,0x00,0x00,0x04,0x00,0x7B,0xE0,0x40,0x20,0x00,0x00},/*"{",91*/
{0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xF0,0x00,0x00,0x00,0x00},/*"|",92*/
{0x00,0x00,0x40,0x20,0x7B,0xE0,0x04,0x00,0x00,0x00,0x00,0x00},/*"}",93*/
{0x40,0x00,0x80,0x00,0x40,0x00,0x20,0x00,0x20,0x00,0x40,0x00},/*"~",94*/
};  
//16*16 ASCII字符集点阵
const unsigned char asc2_1608[95][16]={	  
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*" ",0*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xCC,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00},/*"!",1*/
{0x00,0x00,0x08,0x00,0x30,0x00,0x60,0x00,0x08,0x00,0x30,0x00,0x60,0x00,0x00,0x00},/*""",2*/
{0x02,0x20,0x03,0xFC,0x1E,0x20,0x02,0x20,0x03,0xFC,0x1E,0x20,0x02,0x20,0x00,0x00},/*"#",3*/
{0x00,0x00,0x0E,0x18,0x11,0x04,0x3F,0xFF,0x10,0x84,0x0C,0x78,0x00,0x00,0x00,0x00},/*"$",4*/
{0x0F,0x00,0x10,0x84,0x0F,0x38,0x00,0xC0,0x07,0x78,0x18,0x84,0x00,0x78,0x00,0x00},/*"%",5*/
{0x00,0x78,0x0F,0x84,0x10,0xC4,0x11,0x24,0x0E,0x98,0x00,0xE4,0x00,0x84,0x00,0x08},/*"&",6*/
{0x08,0x00,0x68,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"'",7*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xE0,0x18,0x18,0x20,0x04,0x40,0x02,0x00,0x00},/*"(",8*/
{0x00,0x00,0x40,0x02,0x20,0x04,0x18,0x18,0x07,0xE0,0x00,0x00,0x00,0x00,0x00,0x00},/*")",9*/
{0x02,0x40,0x02,0x40,0x01,0x80,0x0F,0xF0,0x01,0x80,0x02,0x40,0x02,0x40,0x00,0x00},/*"*",10*/
{0x00,0x80,0x00,0x80,0x00,0x80,0x0F,0xF8,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x00},/*"+",11*/
{0x00,0x01,0x00,0x0D,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*",",12*/
{0x00,0x00,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80},/*"-",13*/
{0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*".",14*/
{0x00,0x00,0x00,0x06,0x00,0x18,0x00,0x60,0x01,0x80,0x06,0x00,0x18,0x00,0x20,0x00},/*"/",15*/
{0x00,0x00,0x07,0xF0,0x08,0x08,0x10,0x04,0x10,0x04,0x08,0x08,0x07,0xF0,0x00,0x00},/*"0",16*/
{0x00,0x00,0x08,0x04,0x08,0x04,0x1F,0xFC,0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x00},/*"1",17*/
{0x00,0x00,0x0E,0x0C,0x10,0x14,0x10,0x24,0x10,0x44,0x11,0x84,0x0E,0x0C,0x00,0x00},/*"2",18*/
{0x00,0x00,0x0C,0x18,0x10,0x04,0x11,0x04,0x11,0x04,0x12,0x88,0x0C,0x70,0x00,0x00},/*"3",19*/
{0x00,0x00,0x00,0xE0,0x03,0x20,0x04,0x24,0x08,0x24,0x1F,0xFC,0x00,0x24,0x00,0x00},/*"4",20*/
{0x00,0x00,0x1F,0x98,0x10,0x84,0x11,0x04,0x11,0x04,0x10,0x88,0x10,0x70,0x00,0x00},/*"5",21*/
{0x00,0x00,0x07,0xF0,0x08,0x88,0x11,0x04,0x11,0x04,0x18,0x88,0x00,0x70,0x00,0x00},/*"6",22*/
{0x00,0x00,0x1C,0x00,0x10,0x00,0x10,0xFC,0x13,0x00,0x1C,0x00,0x10,0x00,0x00,0x00},/*"7",23*/
{0x00,0x00,0x0E,0x38,0x11,0x44,0x10,0x84,0x10,0x84,0x11,0x44,0x0E,0x38,0x00,0x00},/*"8",24*/
{0x00,0x00,0x07,0x00,0x08,0x8C,0x10,0x44,0x10,0x44,0x08,0x88,0x07,0xF0,0x00,0x00},/*"9",25*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x0C,0x03,0x0C,0x00,0x00,0x00,0x00,0x00,0x00},/*":",26*/
{0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*";",27*/
{0x00,0x00,0x00,0x80,0x01,0x40,0x02,0x20,0x04,0x10,0x08,0x08,0x10,0x04,0x00,0x00},/*"<",28*/
{0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x00,0x00},/*"=",29*/
{0x00,0x00,0x10,0x04,0x08,0x08,0x04,0x10,0x02,0x20,0x01,0x40,0x00,0x80,0x00,0x00},/*">",30*/
{0x00,0x00,0x0E,0x00,0x12,0x00,0x10,0x0C,0x10,0x6C,0x10,0x80,0x0F,0x00,0x00,0x00},/*"?",31*/
{0x03,0xE0,0x0C,0x18,0x13,0xE4,0x14,0x24,0x17,0xC4,0x08,0x28,0x07,0xD0,0x00,0x00},/*"@",32*/
{0x00,0x04,0x00,0x3C,0x03,0xC4,0x1C,0x40,0x07,0x40,0x00,0xE4,0x00,0x1C,0x00,0x04},/*"A",33*/
{0x10,0x04,0x1F,0xFC,0x11,0x04,0x11,0x04,0x11,0x04,0x0E,0x88,0x00,0x70,0x00,0x00},/*"B",34*/
{0x03,0xE0,0x0C,0x18,0x10,0x04,0x10,0x04,0x10,0x04,0x10,0x08,0x1C,0x10,0x00,0x00},/*"C",35*/
{0x10,0x04,0x1F,0xFC,0x10,0x04,0x10,0x04,0x10,0x04,0x08,0x08,0x07,0xF0,0x00,0x00},/*"D",36*/
{0x10,0x04,0x1F,0xFC,0x11,0x04,0x11,0x04,0x17,0xC4,0x10,0x04,0x08,0x18,0x00,0x00},/*"E",37*/
{0x10,0x04,0x1F,0xFC,0x11,0x04,0x11,0x00,0x17,0xC0,0x10,0x00,0x08,0x00,0x00,0x00},/*"F",38*/
{0x03,0xE0,0x0C,0x18,0x10,0x04,0x10,0x04,0x10,0x44,0x1C,0x78,0x00,0x40,0x00,0x00},/*"G",39*/
{0x10,0x04,0x1F,0xFC,0x10,0x84,0x00,0x80,0x00,0x80,0x10,0x84,0x1F,0xFC,0x10,0x04},/*"H",40*/
{0x00,0x00,0x10,0x04,0x10,0x04,0x1F,0xFC,0x10,0x04,0x10,0x04,0x00,0x00,0x00,0x00},/*"I",41*/
{0x00,0x03,0x00,0x01,0x10,0x01,0x10,0x01,0x1F,0xFE,0x10,0x00,0x10,0x00,0x00,0x00},/*"J",42*/
{0x10,0x04,0x1F,0xFC,0x11,0x04,0x03,0x80,0x14,0x64,0x18,0x1C,0x10,0x04,0x00,0x00},/*"K",43*/
{0x10,0x04,0x1F,0xFC,0x10,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x0C,0x00,0x00},/*"L",44*/
{0x10,0x04,0x1F,0xFC,0x1F,0x00,0x00,0xFC,0x1F,0x00,0x1F,0xFC,0x10,0x04,0x00,0x00},/*"M",45*/
{0x10,0x04,0x1F,0xFC,0x0C,0x04,0x03,0x00,0x00,0xE0,0x10,0x18,0x1F,0xFC,0x10,0x00},/*"N",46*/
{0x07,0xF0,0x08,0x08,0x10,0x04,0x10,0x04,0x10,0x04,0x08,0x08,0x07,0xF0,0x00,0x00},/*"O",47*/
{0x10,0x04,0x1F,0xFC,0x10,0x84,0x10,0x80,0x10,0x80,0x10,0x80,0x0F,0x00,0x00,0x00},/*"P",48*/
{0x07,0xF0,0x08,0x18,0x10,0x24,0x10,0x24,0x10,0x1C,0x08,0x0A,0x07,0xF2,0x00,0x00},/*"Q",49*/
{0x10,0x04,0x1F,0xFC,0x11,0x04,0x11,0x00,0x11,0xC0,0x11,0x30,0x0E,0x0C,0x00,0x04},/*"R",50*/
{0x00,0x00,0x0E,0x1C,0x11,0x04,0x10,0x84,0x10,0x84,0x10,0x44,0x1C,0x38,0x00,0x00},/*"S",51*/
{0x18,0x00,0x10,0x00,0x10,0x04,0x1F,0xFC,0x10,0x04,0x10,0x00,0x18,0x00,0x00,0x00},/*"T",52*/
{0x10,0x00,0x1F,0xF8,0x10,0x04,0x00,0x04,0x00,0x04,0x10,0x04,0x1F,0xF8,0x10,0x00},/*"U",53*/
{0x10,0x00,0x1E,0x00,0x11,0xE0,0x00,0x1C,0x00,0x70,0x13,0x80,0x1C,0x00,0x10,0x00},/*"V",54*/
{0x1F,0xC0,0x10,0x3C,0x00,0xE0,0x1F,0x00,0x00,0xE0,0x10,0x3C,0x1F,0xC0,0x00,0x00},/*"W",55*/
{0x10,0x04,0x18,0x0C,0x16,0x34,0x01,0xC0,0x01,0xC0,0x16,0x34,0x18,0x0C,0x10,0x04},/*"X",56*/
{0x10,0x00,0x1C,0x00,0x13,0x04,0x00,0xFC,0x13,0x04,0x1C,0x00,0x10,0x00,0x00,0x00},/*"Y",57*/
{0x08,0x04,0x10,0x1C,0x10,0x64,0x10,0x84,0x13,0x04,0x1C,0x04,0x10,0x18,0x00,0x00},/*"Z",58*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFE,0x40,0x02,0x40,0x02,0x40,0x02,0x00,0x00},/*"[",59*/
{0x00,0x00,0x30,0x00,0x0C,0x00,0x03,0x80,0x00,0x60,0x00,0x1C,0x00,0x03,0x00,0x00},/*"\",60*/
{0x00,0x00,0x40,0x02,0x40,0x02,0x40,0x02,0x7F,0xFE,0x00,0x00,0x00,0x00,0x00,0x00},/*"]",61*/
{0x00,0x00,0x00,0x00,0x20,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x20,0x00,0x00,0x00},/*"^",62*/
{0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01},/*"_",63*/
{0x00,0x00,0x40,0x00,0x40,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"`",64*/
{0x00,0x00,0x00,0x98,0x01,0x24,0x01,0x44,0x01,0x44,0x01,0x44,0x00,0xFC,0x00,0x04},/*"a",65*/
{0x10,0x00,0x1F,0xFC,0x00,0x88,0x01,0x04,0x01,0x04,0x00,0x88,0x00,0x70,0x00,0x00},/*"b",66*/
{0x00,0x00,0x00,0x70,0x00,0x88,0x01,0x04,0x01,0x04,0x01,0x04,0x00,0x88,0x00,0x00},/*"c",67*/
{0x00,0x00,0x00,0x70,0x00,0x88,0x01,0x04,0x01,0x04,0x11,0x08,0x1F,0xFC,0x00,0x04},/*"d",68*/
{0x00,0x00,0x00,0xF8,0x01,0x44,0x01,0x44,0x01,0x44,0x01,0x44,0x00,0xC8,0x00,0x00},/*"e",69*/
{0x00,0x00,0x01,0x04,0x01,0x04,0x0F,0xFC,0x11,0x04,0x11,0x04,0x11,0x00,0x18,0x00},/*"f",70*/
{0x00,0x00,0x00,0xD6,0x01,0x29,0x01,0x29,0x01,0x29,0x01,0xC9,0x01,0x06,0x00,0x00},/*"g",71*/
{0x10,0x04,0x1F,0xFC,0x00,0x84,0x01,0x00,0x01,0x00,0x01,0x04,0x00,0xFC,0x00,0x04},/*"h",72*/
{0x00,0x00,0x01,0x04,0x19,0x04,0x19,0xFC,0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x00},/*"i",73*/
{0x00,0x00,0x00,0x03,0x00,0x01,0x01,0x01,0x19,0x01,0x19,0xFE,0x00,0x00,0x00,0x00},/*"j",74*/
{0x10,0x04,0x1F,0xFC,0x00,0x24,0x00,0x40,0x01,0xB4,0x01,0x0C,0x01,0x04,0x00,0x00},/*"k",75*/
{0x00,0x00,0x10,0x04,0x10,0x04,0x1F,0xFC,0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x00},/*"l",76*/
{0x01,0x04,0x01,0xFC,0x01,0x04,0x01,0x00,0x01,0xFC,0x01,0x04,0x01,0x00,0x00,0xFC},/*"m",77*/
{0x01,0x04,0x01,0xFC,0x00,0x84,0x01,0x00,0x01,0x00,0x01,0x04,0x00,0xFC,0x00,0x04},/*"n",78*/
{0x00,0x00,0x00,0xF8,0x01,0x04,0x01,0x04,0x01,0x04,0x01,0x04,0x00,0xF8,0x00,0x00},/*"o",79*/
{0x01,0x01,0x01,0xFF,0x00,0x85,0x01,0x04,0x01,0x04,0x00,0x88,0x00,0x70,0x00,0x00},/*"p",80*/
{0x00,0x00,0x00,0x70,0x00,0x88,0x01,0x04,0x01,0x04,0x01,0x05,0x01,0xFF,0x00,0x01},/*"q",81*/
{0x01,0x04,0x01,0x04,0x01,0xFC,0x00,0x84,0x01,0x04,0x01,0x00,0x01,0x80,0x00,0x00},/*"r",82*/
{0x00,0x00,0x00,0xCC,0x01,0x24,0x01,0x24,0x01,0x24,0x01,0x24,0x01,0x98,0x00,0x00},/*"s",83*/
{0x00,0x00,0x01,0x00,0x01,0x00,0x07,0xF8,0x01,0x04,0x01,0x04,0x00,0x00,0x00,0x00},/*"t",84*/
{0x01,0x00,0x01,0xF8,0x00,0x04,0x00,0x04,0x00,0x04,0x01,0x08,0x01,0xFC,0x00,0x04},/*"u",85*/
{0x01,0x00,0x01,0x80,0x01,0x70,0x00,0x0C,0x00,0x10,0x01,0x60,0x01,0x80,0x01,0x00},/*"v",86*/
{0x01,0xF0,0x01,0x0C,0x00,0x30,0x01,0xC0,0x00,0x30,0x01,0x0C,0x01,0xF0,0x01,0x00},/*"w",87*/
{0x00,0x00,0x01,0x04,0x01,0x8C,0x00,0x74,0x01,0x70,0x01,0x8C,0x01,0x04,0x00,0x00},/*"x",88*/
{0x01,0x01,0x01,0x81,0x01,0x71,0x00,0x0E,0x00,0x18,0x01,0x60,0x01,0x80,0x01,0x00},/*"y",89*/
{0x00,0x00,0x01,0x84,0x01,0x0C,0x01,0x34,0x01,0x44,0x01,0x84,0x01,0x0C,0x00,0x00},/*"z",90*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x3E,0xFC,0x40,0x02,0x40,0x02},/*"{",91*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00},/*"|",92*/
{0x00,0x00,0x40,0x02,0x40,0x02,0x3E,0xFC,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"}",93*/
{0x00,0x00,0x60,0x00,0x80,0x00,0x80,0x00,0x40,0x00,0x40,0x00,0x20,0x00,0x20,0x00},/*"~",94*/
};
//24*24 ASICII字符集点阵
const unsigned char asc2_2412[95][36]={	  
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*" ",0*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x80,0x38,0x0F,0xFE,0x38,0x0F,0x80,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"!",1*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x06,0x00,0x00,0x0C,0x00,0x00,0x38,0x00,0x00,0x31,0x00,0x00,0x06,0x00,0x00,0x0C,0x00,0x00,0x38,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00},/*""",2*/
{0x00,0x00,0x00,0x00,0x61,0x80,0x00,0x67,0xF8,0x07,0xF9,0x80,0x00,0x61,0x80,0x00,0x61,0x80,0x00,0x61,0x80,0x00,0x61,0x80,0x00,0x67,0xF8,0x07,0xF9,0x80,0x00,0x61,0x80,0x00,0x00,0x00},/*"#",3*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xC0,0xE0,0x03,0xE0,0xF0,0x06,0x30,0x08,0x04,0x18,0x08,0x1F,0xFF,0xFE,0x04,0x0E,0x08,0x07,0x87,0xF0,0x03,0x81,0xE0,0x00,0x00,0x00,0x00,0x00,0x00},/*"$",4*/
{0x01,0xF0,0x00,0x06,0x0C,0x00,0x04,0x04,0x08,0x06,0x0C,0x70,0x01,0xF9,0xC0,0x00,0x0E,0x00,0x00,0x3B,0xE0,0x00,0xEC,0x18,0x07,0x08,0x08,0x04,0x0C,0x18,0x00,0x03,0xE0,0x00,0x00,0x00},/*"%",5*/
{0x00,0x01,0xE0,0x00,0x07,0xF0,0x03,0xF8,0x18,0x04,0x1C,0x08,0x04,0x17,0x08,0x07,0xE1,0xD0,0x03,0xC0,0xE0,0x00,0x23,0xB0,0x00,0x3C,0x08,0x00,0x20,0x08,0x00,0x00,0x10,0x00,0x00,0x00},/*"&",6*/
{0x00,0x00,0x00,0x01,0x00,0x00,0x31,0x00,0x00,0x32,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},/*"'",7*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x01,0xFF,0xC0,0x07,0x80,0xF0,0x0C,0x00,0x18,0x10,0x00,0x04,0x20,0x00,0x02,0x00,0x00,0x00},/*"(",8*/
{0x00,0x00,0x00,0x20,0x00,0x02,0x10,0x00,0x04,0x0C,0x00,0x18,0x07,0x80,0xF0,0x01,0xFF,0xC0,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*")",9*/
{0x00,0x00,0x00,0x00,0x42,0x00,0x00,0x66,0x00,0x00,0x66,0x00,0x00,0x3C,0x00,0x00,0x18,0x00,0x03,0xFF,0xC0,0x00,0x18,0x00,0x00,0x3C,0x00,0x00,0x66,0x00,0x00,0x66,0x00,0x00,0x42,0x00},/*"*",10*/
{0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x01,0xFF,0xC0,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x00},/*"+",11*/
{0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x31,0x00,0x00,0x32,0x00,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*",",12*/
{0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x00,0x00},/*"-",13*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x38,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*".",14*/
{0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x1C,0x00,0x00,0x70,0x00,0x01,0x80,0x00,0x0E,0x00,0x00,0x38,0x00,0x00,0xC0,0x00,0x07,0x00,0x00,0x1C,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00},/*"/",15*/
{0x00,0x00,0x00,0x00,0x7F,0x80,0x01,0xFF,0xE0,0x03,0x80,0x70,0x06,0x00,0x18,0x04,0x00,0x08,0x04,0x00,0x08,0x06,0x00,0x18,0x03,0x80,0x70,0x01,0xFF,0xE0,0x00,0x7F,0x80,0x00,0x00,0x00},/*"0",16*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x08,0x01,0x00,0x08,0x01,0x00,0x08,0x03,0xFF,0xF8,0x07,0xFF,0xF8,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00},/*"1",17*/
{0x00,0x00,0x00,0x01,0xC0,0x38,0x02,0xC0,0x58,0x04,0x00,0x98,0x04,0x01,0x18,0x04,0x02,0x18,0x04,0x04,0x18,0x06,0x1C,0x18,0x03,0xF8,0x18,0x01,0xE0,0xF8,0x00,0x00,0x00,0x00,0x00,0x00},/*"2",18*/
{0x00,0x00,0x00,0x01,0xC0,0xE0,0x03,0xC0,0xF0,0x04,0x00,0x08,0x04,0x08,0x08,0x04,0x08,0x08,0x06,0x18,0x08,0x03,0xF4,0x18,0x01,0xE7,0xF0,0x00,0x01,0xE0,0x00,0x00,0x00,0x00,0x00,0x00},/*"3",19*/
{0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x0D,0x00,0x00,0x11,0x00,0x00,0x61,0x00,0x00,0x81,0x08,0x03,0x01,0x08,0x07,0xFF,0xF8,0x0F,0xFF,0xF8,0x00,0x01,0x08,0x00,0x01,0x08,0x00,0x00,0x00},/*"4",20*/
{0x00,0x00,0x00,0x00,0x00,0xE0,0x07,0xFC,0xD0,0x06,0x08,0x08,0x06,0x10,0x08,0x06,0x10,0x08,0x06,0x10,0x08,0x06,0x18,0x38,0x06,0x0F,0xF0,0x06,0x07,0xC0,0x00,0x00,0x00,0x00,0x00,0x00},/*"5",21*/
{0x00,0x00,0x00,0x00,0x3F,0x80,0x01,0xFF,0xE0,0x03,0x84,0x30,0x02,0x08,0x18,0x04,0x10,0x08,0x04,0x10,0x08,0x04,0x10,0x08,0x07,0x18,0x10,0x03,0x0F,0xF0,0x00,0x07,0xC0,0x00,0x00,0x00},/*"6",22*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xC0,0x00,0x07,0x00,0x00,0x06,0x00,0x00,0x06,0x00,0xF8,0x06,0x07,0xF8,0x06,0x18,0x00,0x06,0xE0,0x00,0x07,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00},/*"7",23*/
{0x00,0x00,0x00,0x01,0xE1,0xE0,0x03,0xF7,0xF0,0x06,0x34,0x10,0x04,0x18,0x08,0x04,0x18,0x08,0x04,0x0C,0x08,0x04,0x0C,0x08,0x06,0x16,0x18,0x03,0xF3,0xF0,0x01,0xC1,0xE0,0x00,0x00,0x00},/*"8",24*/
{0x00,0x00,0x00,0x00,0xF8,0x00,0x03,0xFC,0x30,0x03,0x06,0x38,0x04,0x02,0x08,0x04,0x02,0x08,0x04,0x02,0x08,0x04,0x04,0x10,0x03,0x08,0xF0,0x01,0xFF,0xC0,0x00,0x7F,0x00,0x00,0x00,0x00},/*"9",25*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x38,0x00,0x70,0x38,0x00,0x70,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*":",26*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x1A,0x00,0x30,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*";",27*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x14,0x00,0x00,0x22,0x00,0x00,0x41,0x00,0x00,0x80,0x80,0x01,0x00,0x40,0x02,0x00,0x20,0x04,0x00,0x10,0x08,0x00,0x08,0x00,0x00,0x00},/*"<",28*/
{0x00,0x00,0x00,0x00,0x21,0x00,0x00,0x21,0x00,0x00,0x21,0x00,0x00,0x21,0x00,0x00,0x21,0x00,0x00,0x21,0x00,0x00,0x21,0x00,0x00,0x21,0x00,0x00,0x21,0x00,0x00,0x21,0x00,0x00,0x00,0x00},/*"=",29*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x08,0x04,0x00,0x10,0x02,0x00,0x20,0x01,0x00,0x40,0x00,0x80,0x80,0x00,0x41,0x00,0x00,0x22,0x00,0x00,0x14,0x00,0x00,0x08,0x00,0x00,0x00,0x00},/*">",30*/
{0x00,0x00,0x00,0x03,0xC0,0x00,0x04,0xC0,0x00,0x04,0x00,0x00,0x08,0x00,0x38,0x08,0x0F,0x38,0x08,0x08,0x38,0x08,0x10,0x00,0x0C,0x30,0x00,0x07,0xE0,0x00,0x03,0xC0,0x00,0x00,0x00,0x00},/*"?",31*/
{0x00,0x00,0x00,0x00,0x3F,0x80,0x00,0xFF,0xE0,0x03,0x80,0x70,0x02,0x0F,0x10,0x06,0x70,0x88,0x04,0xC0,0x88,0x04,0x83,0x08,0x04,0x7F,0x88,0x02,0xC0,0x90,0x03,0x01,0x20,0x00,0xFE,0x40},/*"@",32*/
{0x00,0x00,0x08,0x00,0x00,0x18,0x00,0x01,0xF8,0x00,0x3E,0x08,0x01,0xC2,0x00,0x07,0x02,0x00,0x07,0xE2,0x00,0x00,0xFE,0x00,0x00,0x1F,0xC8,0x00,0x01,0xF8,0x00,0x00,0x38,0x00,0x00,0x08},/*"A",33*/
{0x04,0x00,0x08,0x07,0xFF,0xF8,0x07,0xFF,0xF8,0x04,0x08,0x08,0x04,0x08,0x08,0x04,0x08,0x08,0x04,0x08,0x08,0x06,0x18,0x08,0x03,0xF4,0x18,0x01,0xE7,0xF0,0x00,0x01,0xE0,0x00,0x00,0x00},/*"B",34*/
{0x00,0x00,0x00,0x00,0x3F,0x80,0x01,0xFF,0xE0,0x03,0x80,0x70,0x02,0x00,0x18,0x04,0x00,0x08,0x04,0x00,0x08,0x04,0x00,0x08,0x04,0x00,0x10,0x06,0x00,0x20,0x07,0x80,0xC0,0x00,0x00,0x00},/*"C",35*/
{0x04,0x00,0x08,0x07,0xFF,0xF8,0x07,0xFF,0xF8,0x04,0x00,0x08,0x04,0x00,0x08,0x04,0x00,0x08,0x04,0x00,0x18,0x02,0x00,0x10,0x03,0x80,0x70,0x01,0xFF,0xE0,0x00,0x7F,0x80,0x00,0x00,0x00},/*"D",36*/
{0x04,0x00,0x08,0x07,0xFF,0xF8,0x07,0xFF,0xF8,0x04,0x08,0x08,0x04,0x08,0x08,0x04,0x08,0x08,0x04,0x08,0x08,0x04,0x3E,0x08,0x04,0x00,0x08,0x06,0x00,0x18,0x01,0x00,0x60,0x00,0x00,0x00},/*"E",37*/
{0x04,0x00,0x08,0x07,0xFF,0xF8,0x07,0xFF,0xF8,0x04,0x08,0x08,0x04,0x08,0x00,0x04,0x08,0x00,0x04,0x08,0x00,0x04,0x3E,0x00,0x06,0x00,0x00,0x06,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x00},/*"F",38*/
{0x00,0x00,0x00,0x00,0x3F,0x80,0x01,0xFF,0xE0,0x03,0x80,0x70,0x06,0x00,0x18,0x04,0x00,0x08,0x04,0x02,0x08,0x04,0x02,0x08,0x02,0x03,0xF0,0x07,0x83,0xF0,0x00,0x02,0x00,0x00,0x02,0x00},/*"G",39*/
{0x04,0x00,0x08,0x07,0xFF,0xF8,0x07,0xFF,0xF8,0x04,0x08,0x08,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x04,0x08,0x08,0x07,0xFF,0xF8,0x07,0xFF,0xF8,0x04,0x00,0x08},/*"H",40*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x08,0x04,0x00,0x08,0x04,0x00,0x08,0x07,0xFF,0xF8,0x07,0xFF,0xF8,0x04,0x00,0x08,0x04,0x00,0x08,0x04,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00},/*"I",41*/
{0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x07,0x00,0x00,0x01,0x04,0x00,0x01,0x04,0x00,0x01,0x04,0x00,0x03,0x07,0xFF,0xFE,0x07,0xFF,0xFC,0x04,0x00,0x00,0x04,0x00,0x00,0x04,0x00,0x00},/*"J",42*/
{0x04,0x00,0x08,0x07,0xFF,0xF8,0x07,0xFF,0xF8,0x04,0x0C,0x08,0x00,0x18,0x00,0x00,0x3E,0x00,0x04,0xC7,0x80,0x05,0x03,0xC8,0x06,0x00,0xF8,0x04,0x00,0x38,0x04,0x00,0x18,0x00,0x00,0x08},/*"K",43*/
{0x04,0x00,0x08,0x07,0xFF,0xF8,0x07,0xFF,0xF8,0x04,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x18,0x00,0x00,0x60,0x00,0x00,0x00},/*"L",44*/
{0x04,0x00,0x08,0x07,0xFF,0xF8,0x07,0x80,0x08,0x07,0xFC,0x00,0x00,0x7F,0xC0,0x00,0x03,0xF8,0x00,0x07,0xC0,0x00,0x78,0x00,0x07,0x80,0x08,0x07,0xFF,0xF8,0x07,0xFF,0xF8,0x04,0x00,0x08},/*"M",45*/
{0x04,0x00,0x08,0x07,0xFF,0xF8,0x07,0x00,0x08,0x03,0xC0,0x00,0x00,0xE0,0x00,0x00,0x38,0x00,0x00,0x1E,0x00,0x00,0x07,0x00,0x00,0x01,0xC0,0x04,0x00,0xF0,0x07,0xFF,0xF8,0x04,0x00,0x00},/*"N",46*/
{0x00,0x00,0x00,0x00,0x7F,0x80,0x01,0xFF,0xE0,0x03,0x80,0x70,0x06,0x00,0x18,0x04,0x00,0x08,0x04,0x00,0x08,0x06,0x00,0x18,0x03,0x00,0x30,0x01,0xFF,0xE0,0x00,0x7F,0x80,0x00,0x00,0x00},/*"O",47*/
{0x04,0x00,0x08,0x07,0xFF,0xF8,0x07,0xFF,0xF8,0x04,0x04,0x08,0x04,0x04,0x00,0x04,0x04,0x00,0x04,0x04,0x00,0x04,0x04,0x00,0x06,0x0C,0x00,0x03,0xF8,0x00,0x01,0xF0,0x00,0x00,0x00,0x00},/*"P",48*/
{0x00,0x00,0x00,0x00,0x7F,0x80,0x01,0xFF,0xE0,0x03,0x80,0x70,0x06,0x00,0x88,0x04,0x00,0x88,0x04,0x00,0xC8,0x06,0x00,0x3C,0x03,0x00,0x3E,0x01,0xFF,0xE6,0x00,0x7F,0x84,0x00,0x00,0x00},/*"Q",49*/
{0x04,0x00,0x08,0x07,0xFF,0xF8,0x07,0xFF,0xF8,0x04,0x08,0x08,0x04,0x08,0x00,0x04,0x0C,0x00,0x04,0x0F,0x00,0x04,0x0B,0xC0,0x06,0x10,0xF0,0x03,0xF0,0x38,0x01,0xE0,0x08,0x00,0x00,0x08},/*"R",50*/
{0x00,0x00,0x00,0x01,0xE0,0xF8,0x03,0xF0,0x30,0x06,0x30,0x10,0x04,0x18,0x08,0x04,0x18,0x08,0x04,0x0C,0x08,0x04,0x0C,0x08,0x02,0x06,0x18,0x02,0x07,0xF0,0x07,0x81,0xE0,0x00,0x00,0x00},/*"S",51*/
{0x01,0x80,0x00,0x06,0x00,0x00,0x04,0x00,0x00,0x04,0x00,0x00,0x04,0x00,0x08,0x07,0xFF,0xF8,0x07,0xFF,0xF8,0x04,0x00,0x08,0x04,0x00,0x00,0x04,0x00,0x00,0x06,0x00,0x00,0x01,0x80,0x00},/*"T",52*/
{0x04,0x00,0x00,0x07,0xFF,0xE0,0x07,0xFF,0xF0,0x04,0x00,0x18,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x04,0x00,0x10,0x07,0xFF,0xE0,0x04,0x00,0x00},/*"U",53*/
{0x04,0x00,0x00,0x06,0x00,0x00,0x07,0xE0,0x00,0x07,0xFE,0x00,0x04,0x1F,0xE0,0x00,0x01,0xF8,0x00,0x00,0x38,0x00,0x01,0xE0,0x04,0x3E,0x00,0x07,0xC0,0x00,0x06,0x00,0x00,0x04,0x00,0x00},/*"V",54*/
{0x04,0x00,0x00,0x07,0xE0,0x00,0x07,0xFF,0xC0,0x04,0x1F,0xF8,0x00,0x07,0xC0,0x07,0xF8,0x00,0x07,0xFF,0x80,0x04,0x3F,0xF8,0x00,0x07,0xC0,0x04,0xF8,0x00,0x07,0x00,0x00,0x04,0x00,0x00},/*"W",55*/
{0x00,0x00,0x00,0x04,0x00,0x08,0x06,0x00,0x18,0x07,0xC0,0x78,0x05,0xF1,0xC8,0x00,0x3E,0x00,0x00,0x1F,0x80,0x04,0x63,0xE8,0x07,0x80,0xF8,0x06,0x00,0x18,0x04,0x00,0x08,0x00,0x00,0x00},/*"X",56*/
{0x04,0x00,0x00,0x06,0x00,0x00,0x07,0x80,0x00,0x07,0xE0,0x08,0x04,0x7C,0x08,0x00,0x1F,0xF8,0x00,0x07,0xF8,0x00,0x18,0x08,0x04,0xE0,0x08,0x07,0x00,0x00,0x06,0x00,0x00,0x04,0x00,0x00},/*"Y",57*/
{0x00,0x00,0x00,0x01,0x00,0x08,0x06,0x00,0x38,0x04,0x00,0xF8,0x04,0x03,0xE8,0x04,0x0F,0x08,0x04,0x7C,0x08,0x05,0xF0,0x08,0x07,0xC0,0x08,0x07,0x00,0x18,0x04,0x00,0x60,0x00,0x00,0x00},/*"Z",58*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFE,0x20,0x00,0x02,0x20,0x00,0x02,0x20,0x00,0x02,0x20,0x00,0x02,0x20,0x00,0x02,0x00,0x00,0x00},/*"[",59*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x07,0x00,0x00,0x00,0xC0,0x00,0x00,0x38,0x00,0x00,0x06,0x00,0x00,0x01,0xC0,0x00,0x00,0x30,0x00,0x00,0x0E,0x00,0x00,0x01,0x00,0x00,0x00},/*"\",60*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x02,0x20,0x00,0x02,0x20,0x00,0x02,0x20,0x00,0x02,0x20,0x00,0x02,0x3F,0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"]",61*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x10,0x00,0x00,0x30,0x00,0x00,0x20,0x00,0x00,0x30,0x00,0x00,0x10,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"^",62*/
{0x00,0x00,0x01,0x00,0x00,0x01,0x00,0x00,0x01,0x00,0x00,0x01,0x00,0x00,0x01,0x00,0x00,0x01,0x00,0x00,0x01,0x00,0x00,0x01,0x00,0x00,0x01,0x00,0x00,0x01,0x00,0x00,0x01,0x00,0x00,0x01},/*"_",63*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x20,0x00,0x00,0x10,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"`",64*/
{0x00,0x00,0x00,0x00,0x00,0xF0,0x00,0x19,0xF8,0x00,0x1B,0x18,0x00,0x22,0x08,0x00,0x26,0x08,0x00,0x24,0x08,0x00,0x24,0x10,0x00,0x3F,0xF8,0x00,0x1F,0xF8,0x00,0x00,0x08,0x00,0x00,0x18},/*"a",65*/
{0x00,0x00,0x00,0x04,0x00,0x00,0x07,0xFF,0xF8,0x0F,0xFF,0xF0,0x00,0x18,0x18,0x00,0x10,0x08,0x00,0x20,0x08,0x00,0x20,0x08,0x00,0x30,0x18,0x00,0x1F,0xF0,0x00,0x0F,0xC0,0x00,0x00,0x00},/*"b",66*/
{0x00,0x00,0x00,0x00,0x07,0xC0,0x00,0x1F,0xF0,0x00,0x18,0x30,0x00,0x20,0x08,0x00,0x20,0x08,0x00,0x20,0x08,0x00,0x3C,0x08,0x00,0x1C,0x10,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00},/*"c",67*/
{0x00,0x00,0x00,0x00,0x07,0xC0,0x00,0x1F,0xF0,0x00,0x38,0x18,0x00,0x20,0x08,0x00,0x20,0x08,0x00,0x20,0x08,0x04,0x10,0x10,0x07,0xFF,0xF8,0x0F,0xFF,0xF0,0x00,0x00,0x10,0x00,0x00,0x00},/*"d",68*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xC0,0x00,0x1F,0xF0,0x00,0x12,0x30,0x00,0x22,0x18,0x00,0x22,0x08,0x00,0x22,0x08,0x00,0x32,0x08,0x00,0x1E,0x10,0x00,0x0E,0x20,0x00,0x00,0x00},/*"e",69*/
{0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x20,0x08,0x00,0x20,0x08,0x01,0xFF,0xF8,0x03,0xFF,0xF8,0x06,0x20,0x08,0x04,0x20,0x08,0x04,0x20,0x08,0x07,0x20,0x00,0x03,0x00,0x00,0x00,0x00,0x00},/*"f",70*/
{0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x0E,0x6E,0x00,0x1F,0xF3,0x00,0x31,0xB1,0x00,0x20,0xB1,0x00,0x20,0xB1,0x00,0x31,0x91,0x00,0x1F,0x13,0x00,0x2E,0x1E,0x00,0x20,0x0E,0x00,0x30,0x00},/*"g",71*/
{0x00,0x00,0x00,0x04,0x00,0x08,0x07,0xFF,0xF8,0x0F,0xFF,0xF8,0x00,0x10,0x08,0x00,0x20,0x00,0x00,0x20,0x00,0x00,0x20,0x08,0x00,0x3F,0xF8,0x00,0x1F,0xF8,0x00,0x00,0x08,0x00,0x00,0x00},/*"h",72*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x08,0x00,0x20,0x08,0x00,0x20,0x08,0x06,0x3F,0xF8,0x06,0x3F,0xF8,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00},/*"i",73*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x03,0x00,0x20,0x01,0x00,0x20,0x01,0x00,0x20,0x03,0x06,0x3F,0xFE,0x06,0x3F,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"j",74*/
{0x00,0x00,0x00,0x04,0x00,0x08,0x07,0xFF,0xF8,0x0F,0xFF,0xF8,0x00,0x01,0x88,0x00,0x03,0x00,0x00,0x2F,0xC0,0x00,0x38,0xF8,0x00,0x20,0x38,0x00,0x20,0x08,0x00,0x00,0x08,0x00,0x00,0x00},/*"k",75*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x08,0x04,0x00,0x08,0x04,0x00,0x08,0x07,0xFF,0xF8,0x0F,0xFF,0xF8,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00},/*"l",76*/
{0x00,0x20,0x08,0x00,0x3F,0xF8,0x00,0x3F,0xF8,0x00,0x10,0x08,0x00,0x20,0x00,0x00,0x3F,0xF8,0x00,0x3F,0xF8,0x00,0x10,0x08,0x00,0x20,0x00,0x00,0x3F,0xF8,0x00,0x3F,0xF8,0x00,0x00,0x08},/*"m",77*/
{0x00,0x00,0x00,0x00,0x20,0x08,0x00,0x3F,0xF8,0x00,0x3F,0xF8,0x00,0x10,0x08,0x00,0x10,0x00,0x00,0x20,0x00,0x00,0x20,0x08,0x00,0x3F,0xF8,0x00,0x1F,0xF8,0x00,0x00,0x08,0x00,0x00,0x00},/*"n",78*/
{0x00,0x00,0x00,0x00,0x07,0xC0,0x00,0x0F,0xF0,0x00,0x18,0x30,0x00,0x30,0x08,0x00,0x20,0x08,0x00,0x20,0x08,0x00,0x30,0x08,0x00,0x18,0x30,0x00,0x0F,0xF0,0x00,0x07,0xC0,0x00,0x00,0x00},/*"o",79*/
{0x00,0x00,0x00,0x00,0x20,0x01,0x00,0x3F,0xFF,0x00,0x3F,0xFF,0x00,0x10,0x11,0x00,0x20,0x09,0x00,0x20,0x08,0x00,0x20,0x08,0x00,0x30,0x38,0x00,0x1F,0xF0,0x00,0x0F,0xC0,0x00,0x00,0x00},/*"p",80*/
{0x00,0x00,0x00,0x00,0x07,0xC0,0x00,0x1F,0xF0,0x00,0x38,0x18,0x00,0x20,0x08,0x00,0x20,0x08,0x00,0x20,0x09,0x00,0x10,0x11,0x00,0x1F,0xFF,0x00,0x3F,0xFF,0x00,0x00,0x01,0x00,0x00,0x00},/*"q",81*/
{0x00,0x20,0x08,0x00,0x20,0x08,0x00,0x20,0x08,0x00,0x3F,0xF8,0x00,0x3F,0xF8,0x00,0x08,0x08,0x00,0x10,0x08,0x00,0x20,0x08,0x00,0x20,0x00,0x00,0x30,0x00,0x00,0x30,0x00,0x00,0x00,0x00},/*"r",82*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x78,0x00,0x1E,0x18,0x00,0x33,0x08,0x00,0x23,0x08,0x00,0x21,0x08,0x00,0x21,0x88,0x00,0x21,0x98,0x00,0x30,0xF0,0x00,0x38,0x60,0x00,0x00,0x00},/*"s",83*/
{0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x20,0x00,0x00,0x20,0x00,0x00,0xFF,0xF0,0x03,0xFF,0xF8,0x00,0x20,0x08,0x00,0x20,0x08,0x00,0x20,0x08,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00},/*"t",84*/
{0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x3F,0xF0,0x00,0x7F,0xF8,0x00,0x00,0x18,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x20,0x10,0x00,0x3F,0xF8,0x00,0x7F,0xF0,0x00,0x00,0x10,0x00,0x00,0x00},/*"u",85*/
{0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x30,0x00,0x00,0x3C,0x00,0x00,0x3F,0x80,0x00,0x23,0xF0,0x00,0x00,0x78,0x00,0x00,0x70,0x00,0x23,0x80,0x00,0x3C,0x00,0x00,0x30,0x00,0x00,0x20,0x00},/*"v",86*/
{0x00,0x20,0x00,0x00,0x3C,0x00,0x00,0x3F,0xE0,0x00,0x23,0xF8,0x00,0x00,0xE0,0x00,0x27,0x00,0x00,0x3E,0x00,0x00,0x3F,0xE0,0x00,0x21,0xF8,0x00,0x01,0xE0,0x00,0x3E,0x00,0x00,0x20,0x00},/*"w",87*/
{0x00,0x00,0x00,0x00,0x20,0x08,0x00,0x20,0x08,0x00,0x38,0x38,0x00,0x3E,0x68,0x00,0x27,0x80,0x00,0x03,0xC8,0x00,0x2C,0xF8,0x00,0x38,0x38,0x00,0x20,0x18,0x00,0x20,0x08,0x00,0x00,0x00},/*"x",88*/
{0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x30,0x03,0x00,0x3C,0x01,0x00,0x3F,0x83,0x00,0x23,0xEC,0x00,0x00,0x70,0x00,0x23,0x80,0x00,0x3C,0x00,0x00,0x20,0x00,0x00,0x20,0x00,0x00,0x00,0x00},/*"y",89*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x08,0x00,0x20,0x38,0x00,0x20,0xF8,0x00,0x23,0xE8,0x00,0x2F,0x88,0x00,0x3E,0x08,0x00,0x38,0x08,0x00,0x20,0x18,0x00,0x00,0x70,0x00,0x00,0x00},/*"z",90*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x14,0x00,0x1F,0xF7,0xFC,0x30,0x00,0x06,0x20,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00},/*"{",91*/
{0x00,0x00,0x00,0x00,0x00,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,0x00,0x00,0x00},/*"|",92*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x02,0x30,0x00,0x06,0x1F,0xF7,0xFC,0x00,0x14,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"}",93*/
{0x00,0x00,0x00,0x18,0x00,0x00,0x60,0x00,0x00,0x40,0x00,0x00,0x40,0x00,0x00,0x20,0x00,0x00,0x10,0x00,0x00,0x08,0x00,0x00,0x04,0x00,0x00,0x04,0x00,0x00,0x0C,0x00,0x00,0x10,0x00,0x00},/*"~",94*/
};
unsigned char Hzk1[22][16]={
{0x00,0x00,0xF0,0x10,0x10,0x10,0x10,0xFF,0x10,0x10,0x10,0x10,0xF0,0x00,0x00,0x00},
{0x00,0x00,0x0F,0x04,0x04,0x04,0x04,0xFF,0x04,0x04,0x04,0x04,0x0F,0x00,0x00,0x00},/*"中",0*/

{0x40,0x40,0x40,0x5F,0x55,0x55,0x55,0x75,0x55,0x55,0x55,0x5F,0x40,0x40,0x40,0x00},
{0x00,0x40,0x20,0x0F,0x09,0x49,0x89,0x79,0x09,0x09,0x09,0x0F,0x20,0x40,0x00,0x00},/*"景",1*/

{0x00,0xFE,0x02,0x42,0x4A,0xCA,0x4A,0x4A,0xCA,0x4A,0x4A,0x42,0x02,0xFE,0x00,0x00},
{0x00,0xFF,0x40,0x50,0x4C,0x43,0x40,0x40,0x4F,0x50,0x50,0x5C,0x40,0xFF,0x00,0x00},/*"园",2*/

{0x00,0x00,0xF8,0x88,0x88,0x88,0x88,0xFF,0x88,0x88,0x88,0x88,0xF8,0x00,0x00,0x00},
{0x00,0x00,0x1F,0x08,0x08,0x08,0x08,0x7F,0x88,0x88,0x88,0x88,0x9F,0x80,0xF0,0x00},/*"电",3*/

{0x80,0x82,0x82,0x82,0x82,0x82,0x82,0xE2,0xA2,0x92,0x8A,0x86,0x82,0x80,0x80,0x00},
{0x00,0x00,0x00,0x00,0x00,0x40,0x80,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"子",4*/

{0x24,0x24,0xA4,0xFE,0xA3,0x22,0x00,0x22,0xCC,0x00,0x00,0xFF,0x00,0x00,0x00,0x00},
{0x08,0x06,0x01,0xFF,0x00,0x01,0x04,0x04,0x04,0x04,0x04,0xFF,0x02,0x02,0x02,0x00},/*"科",5*/

{0x10,0x10,0x10,0xFF,0x10,0x90,0x08,0x88,0x88,0x88,0xFF,0x88,0x88,0x88,0x08,0x00},
{0x04,0x44,0x82,0x7F,0x01,0x80,0x80,0x40,0x43,0x2C,0x10,0x28,0x46,0x81,0x80,0x00},/*"技",6*/

{0x04,0x04,0x04,0x84,0xE4,0x3C,0x27,0x24,0x24,0x24,0x24,0xE4,0x04,0x04,0x04,0x00},
{0x04,0x02,0x01,0x00,0xFF,0x09,0x09,0x09,0x09,0x49,0x89,0x7F,0x00,0x00,0x00,0x00},/*"有",7*/

{0x00,0xFE,0x22,0x5A,0x86,0x00,0xFE,0x92,0x92,0x92,0x92,0x92,0xFE,0x00,0x00,0x00},
{0x00,0xFF,0x04,0x08,0x07,0x00,0xFF,0x40,0x20,0x03,0x0C,0x14,0x22,0x41,0x40,0x00},/*"限",8*/

{0x00,0x80,0x40,0x20,0x18,0x06,0x80,0x00,0x07,0x18,0x20,0x40,0x80,0x00,0x00,0x00},
{0x01,0x00,0x20,0x70,0x28,0x26,0x21,0x20,0x20,0x24,0x38,0x60,0x00,0x01,0x01,0x00},/*"公",9*/

{0x00,0x10,0x12,0x92,0x92,0x92,0x92,0x92,0x92,0x12,0x12,0x02,0xFE,0x00,0x00,0x00},
{0x00,0x00,0x00,0x3F,0x10,0x10,0x10,0x10,0x3F,0x00,0x40,0x80,0x7F,0x00,0x00,0x00},/*"司",10*/

};
unsigned char Hzk2[3][72]={
{0x00,0x00,0x00,0xC0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xFC,0x84,0x80,0x80,0x80,0x80,0x80,0x80,0xC0,0xC0,0x00,0x00,0x00},
{0x00,0x00,0x00,0xFF,0x7F,0x40,0x40,0x40,0x40,0x40,0x40,0xFF,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xFF,0x7F,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},	/*"中",0*/
};
unsigned char Hzk3[4][128]={
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0xFF,0xFE,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0xFF,0xFF,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0xFF,0x03,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x1F,0x1F,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0xFF,0xFF,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x1F,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"中",0*/
};

unsigned char Hzk4[8][512]={
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0xF8,0xF0,0xF0,0x70,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFE,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0xFF,0xFF,0xFF,0xFF,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0xFF,0xFF,0xFF,0xFF,0x07,0x02,0x00,0x00,0x00,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,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0xFF,0xFF,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,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,0xFF,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,0x1F,0x1F,0x0F,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},/*"中",0*/
};

unsigned char Hzk5[16][32]={
{0x10,0x60,0x02,0x8C,0x00,0x00,0xFE,0x92,0x92,0x92,0x92,0x92,0xFE,0x00,0x00,0x00},
{0x04,0x04,0x7E,0x01,0x40,0x7E,0x42,0x42,0x7E,0x42,0x7E,0x42,0x42,0x7E,0x40,0x00},/*"温",0*/	

{0x10,0x60,0x02,0x8C,0x00,0xFE,0x92,0x92,0x92,0x92,0x92,0x92,0xFE,0x00,0x00,0x00},
{0x04,0x04,0x7E,0x01,0x44,0x48,0x50,0x7F,0x40,0x40,0x7F,0x50,0x48,0x44,0x40,0x00},/*"湿",1*/

{0x00,0x00,0xFC,0x24,0x24,0x24,0xFC,0x25,0x26,0x24,0xFC,0x24,0x24,0x24,0x04,0x00},
{0x40,0x30,0x8F,0x80,0x84,0x4C,0x55,0x25,0x25,0x25,0x55,0x4C,0x80,0x80,0x80,0x00},/*"度",2*/

{0x80,0x70,0x00,0xFF,0x10,0x08,0xFE,0x42,0x42,0x42,0xFA,0x42,0x42,0x42,0xFE,0x00},
{0x80,0x60,0x18,0x07,0x08,0x10,0xFF,0x50,0x48,0x46,0x41,0x42,0x4C,0x40,0xFF,0x00},/*"烟",3*/

{0x10,0x0C,0x05,0x55,0x55,0xD5,0x05,0x7F,0x05,0x55,0x55,0x55,0x05,0x14,0x0C,0x00},
{0x10,0x10,0x10,0x8A,0xA9,0x6B,0x35,0x25,0x25,0xAB,0xE9,0x08,0x10,0x10,0x10,0x00},/*"雾",4*/

{0x10,0x60,0x02,0x8C,0x20,0x18,0x08,0xC8,0x38,0xCF,0x08,0x08,0x28,0x98,0x00,0x00},
{0x04,0x04,0x7E,0x01,0x04,0x02,0x01,0xFF,0x40,0x21,0x06,0x0A,0x11,0x20,0x40,0x00},/*"浓",5*/

{0x00,0xF8,0x01,0x22,0xA0,0xA2,0xA2,0x22,0xFE,0x22,0xAA,0x32,0x02,0xFE,0x00,0x00},
{0x00,0xFF,0x00,0x10,0x13,0x0A,0x4B,0x20,0x17,0x0C,0x13,0x38,0x80,0xFF,0x00,0x00},/*"阈",6*/

{0x00,0x80,0x60,0xF8,0x07,0x04,0xE4,0xA4,0xA4,0xBF,0xA4,0xA4,0xE4,0x04,0x00,0x00},
{0x01,0x00,0x00,0xFF,0x40,0x40,0x7F,0x4A,0x4A,0x4A,0x4A,0x4A,0x7F,0x40,0x40,0x00},/*"值",7*/
};

unsigned char Hzk6[26][32]={
{0x04,0x84,0x84,0xFC,0x84,0x84,0x00,0xFE,0x02,0x02,0xF2,0x02,0x02,0xFE,0x00,0x00},
{0x20,0x60,0x20,0x1F,0x10,0x90,0x40,0x23,0x18,0x06,0x01,0x7E,0x80,0x83,0xE0,0x00},/*"现",0*/
/* (16 X 16 , 宋体 )*/

{0x08,0x08,0x88,0xC8,0x38,0x0C,0x0B,0x08,0x08,0xE8,0x08,0x08,0x08,0x08,0x08,0x00},
{0x02,0x01,0x00,0xFF,0x40,0x41,0x41,0x41,0x41,0x7F,0x41,0x41,0x41,0x41,0x40,0x00},/*"在",1*/
/* (16 X 16 , 宋体 )*/

{0x00,0x02,0x02,0xF2,0x12,0x12,0x12,0xF2,0x02,0x02,0x02,0xFE,0x02,0x02,0x02,0x00},
{0x00,0x00,0x00,0x0F,0x04,0x04,0x04,0x0F,0x00,0x40,0x80,0x7F,0x00,0x00,0x00,0x00},/*"可",2*/
/* (16 X 16 , 宋体 )*/

{0x00,0x00,0xFC,0x00,0x00,0x02,0x04,0x18,0x00,0x00,0x80,0x7F,0x00,0x00,0x00,0x00},
{0x00,0x00,0x3F,0x10,0x08,0x84,0x40,0x20,0x10,0x0C,0x03,0x08,0x10,0x20,0xC0,0x00},/*"以",3*/
/* (16 X 16 , 宋体 )*/

{0x40,0x42,0xCC,0x00,0x00,0xFE,0x82,0x92,0x92,0xFE,0x92,0x92,0x82,0xFE,0x00,0x00},
{0x00,0x00,0x3F,0x10,0x88,0x7F,0x00,0x1E,0x12,0x12,0x12,0x5E,0x80,0x7F,0x00,0x00},/*"调",4*/
/* (16 X 16 , 宋体 )*/

{0x04,0x74,0xD4,0x54,0xFF,0x54,0xD4,0x74,0x14,0x08,0x77,0x84,0x44,0x3C,0x04,0x00},
{0x82,0x89,0x88,0xE8,0x8B,0x88,0x88,0xF9,0xA8,0xAA,0xA9,0xA8,0xA9,0x8A,0x82,0x00},/*"整",5*/
/* (16 X 16 , 宋体 )*/

{0x10,0x0C,0x44,0x24,0x14,0x04,0x05,0x06,0x04,0x04,0x14,0x24,0x44,0x14,0x0C,0x00},
{0x00,0x40,0x40,0x41,0x41,0x41,0x41,0x7F,0x41,0x41,0x41,0x41,0x40,0x40,0x00,0x00},/*"空",6*/
/* (16 X 16 , 宋体 )*/

{0x20,0x10,0x4C,0x47,0x54,0x54,0x54,0x54,0x54,0x54,0x54,0xD4,0x04,0x04,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x30,0x40,0xF0,0x00},/*"气",7*/
/* (16 X 16 , 宋体 )*/

{0x00,0x00,0xFE,0x12,0x12,0x92,0x92,0x92,0x92,0xFF,0x91,0x91,0x91,0x91,0x10,0x00},
{0x80,0x60,0x1F,0x80,0x80,0x5F,0x40,0x20,0x10,0x0E,0x10,0x10,0x20,0x5F,0x80,0x00},/*"质",8*/
/* (16 X 16 , 宋体 )*/

{0x20,0x20,0x20,0xBE,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xBE,0x20,0x20,0x20,0x00},
{0x00,0x80,0x80,0xAF,0xAA,0xAA,0xAA,0xFF,0xAA,0xAA,0xAA,0xAF,0x80,0x80,0x00,0x00},/*"量",9*/
/* (16 X 16 , 宋体 )*/

{0x00,0x80,0x60,0xF8,0x07,0x10,0x10,0x10,0xFF,0x10,0xF0,0x11,0x16,0x10,0x10,0x00},
{0x01,0x00,0x00,0xFF,0x00,0x80,0x60,0x1C,0x03,0x00,0x3F,0x40,0x40,0x40,0x78,0x00},/*"优",10*/
/* (16 X 16 , 宋体 )*/

{0x00,0x00,0xFC,0x24,0x24,0x24,0x25,0x26,0x24,0x24,0x24,0xFC,0x00,0x00,0x00,0x00},
{0x00,0x00,0xFF,0x81,0x41,0x21,0x03,0x05,0x09,0x11,0x29,0x45,0x42,0x80,0x80,0x00},/*"良",11*/
/* (16 X 16 , 宋体 )*/

{0x00,0x04,0x24,0x24,0x25,0x26,0xE4,0x3C,0x24,0x26,0x25,0x24,0x24,0x04,0x00,0x00},
{0x41,0x21,0x11,0x89,0x85,0x8B,0x89,0x89,0xF9,0x89,0x89,0x89,0x89,0x81,0x01,0x00},/*"差",12*/
/* (16 X 16 , 宋体 )*/


};
#endif

        Wi-Fi module function implementation

        ​​​​ ESP8266-01S can communicate with other devices through the serial port, including 32-bit microcontrollers. When using ESP8266-01S on a 32 microcontroller, the ESP8266-01S can be set to transparent transmission mode to achieve data sending and receiving. Transparent transmission mode refers to the working mode in which ESP8266-01S is set to forward all data received by the serial port to the Wi-Fi network, and forward all data received by the Wi-Fi network to the serial port. In transparent transmission mode, ESP8266-01S acts as a transparent serial port transponder, bridging the transmission between serial port data and Wi-Fi data. To use the ESP8266-01S module on STM32, there are the following steps. First, initialize ESP8266-01S: On the 32 microcontroller, you need to send an initialization command to ESP8266-01S through the serial port to set the transparent transmission mode, working mode and other parameters. You can use AT commands for initialization, such as AT+RST to restart the module, AT+CWMODE=2 to set the module working mode to AP mode, etc.; secondly, after setting the module to AP mode, use the AT command AT+CWSAP to set the hotspot name of the module. and password, use AT+CIPSERVER=1 to make the module a TCP server, so that the App can connect to the module as a TCP client and transmit data; thirdly, use the "AT+CIPSEND" instruction in the main function to give the TCP The client sends data and receives data using the interrupt function.

        esp8266.c

#include "esp8266.h"

void atk_8266_start_trans(void)
{
	u8 ret = 0;
	
	delay_ms(1000);
	delay_ms(1000);
	
	ret = atk_8266_send_cmd("AT","OK", 100);
	if(ret == 0 ) printf("AT成功\n");
	else printf("AT fail\n");
	delay_ms(1000);
		
	ret = atk_8266_send_cmd ("AT+RST" , NULL ,100);
	if(ret == 0 ) printf("AT+RST成功\n");
	else printf("AT+RST fail\n");
    delay_ms(2000);
		
    ret = atk_8266_send_cmd("AT+CWMODE=2","OK",200);//开启热点
	if(ret == 0 ) printf("AT+CWMODE=2\n");
	else printf("AT+CWMODE fail\n");
	delay_ms(1000);	
	
	ret = atk_8266_send_cmd("AT+CWSAP=\"ESP8266-ly\",\"123456789\",11,0","OK",100);//设置热点
    if(ret == 0 ) printf("AT+CWSAP成功\n");
	else printf("AT+CWSAP fail\n");
	delay_ms(1000);

	ret = atk_8266_send_cmd("AT+CIPMUX=1","OK",20);//=0:单路连接模式=1:多路连接模式
    if(ret == 0 ) printf("AT+CIPMUX=1\n");
	else printf("AT+CIPMUX=1 fail\n");
	delay_ms(1000);
	
	ret = atk_8266_send_cmd("AT+CIPSERVER=1","OK",200);//启动TCP服务器
	if(ret == 0 ) printf("AT+CIPSERVER=1\n");
	else printf("AT+CIPSERVER fail\n");
	delay_ms(1000);

}

u8 atk_8266_check_cmd(char *str)
{
	
	if(USART3_RX_STA&0x8000)//接收到一次数据
	{
		USART3_RX_BUF[USART3_RX_STA&0x7fff]=0;//添加结束符
		if(strstr((const char*)USART3_RX_BUF,(const char*)str))
			return 1;
		else
			return 0;
		

	}
	return 0;
}

//向atk_8266发送命令
//cmd:发送的命令字符串; ack:期待的应答结果,如果为空,则表示不需要等待应答;waittime:等待时间(单位:10ms)
//返回值:0,发送成功(得到了期待的应答结果);1,发送失败
u8 atk_8266_send_cmd(char *cmd, char *ack,u16 waittime)
{
	u8 res=0;
	USART3_RX_STA=0;
	u3_printf("%s\r\n",cmd);//发送命令
	
	if(ack && waittime)//需要等待应答
	{
		while(--waittime)//等待倒计时
		{
			delay_ms(100);
		    if(USART3_RX_STA&0x8000)//接收到期待的应答结果
		    {
				if(atk_8266_check_cmd(ack))
					{
						printf("ack:%s\r\n",(u8*)ack);
						break;//得到有效数据
					}
			}
			USART3_RX_STA=0;
		}
		if(waittime==0)res=1;
	}
	return res;
}

//向atk_8266发送数据
//cmd:发送的命令字符串;waittime:等待时间(单位:10ms)
//返回值:发送数据后,服务器的返回验证码
u8* atk_8266_send_data(char  *cmd,u16 waittime)
{
	char temp[5];
	char *ack=temp;
	USART3_RX_STA=0;
	u3_printf("%s\r\n",cmd);//发送命令
	if(waittime)//需要等待应答
	{
		while(--waittime)//等待倒计时
		{
			delay_ms(10);
			if(USART3_RX_STA&0X8000)//接收到期待的应答结果
			{
				USART3_RX_BUF[USART3_RX_STA&0X7fff]=0;//添加结束符
				ack=(char*)USART3_RX_BUF;
				printf("ack:%s\r\n",(u8*)ack);
				USART3_RX_STA=0;
				break;
			}
		}
	}
	return (u8*)ack;
}

        uart.c

#include "uart.h"

void UART1_Config(void)
{
	GPIO_InitTypeDef GPIO_InitStructure;
	USART_InitTypeDef USART_InitStructure;
	NVIC_InitTypeDef NVIC_InitStructure;

	//初始化GPIOA的时钟
	RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);

	//初始化串口1的时钟
	RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1, ENABLE);
	
	//通过结构体初始化串口引脚
	GPIO_InitStructure.GPIO_Pin 	= GPIO_Pin_9 | GPIO_Pin_10;			//配置的引脚
	GPIO_InitStructure.GPIO_Mode 	= GPIO_Mode_AF;				//复用模式
	GPIO_InitStructure.GPIO_OType 	= GPIO_OType_PP;		//推挽模式
	GPIO_InitStructure.GPIO_Speed 	= GPIO_Speed_100MHz;	//速度为100MHz
	GPIO_InitStructure.GPIO_PuPd 	= GPIO_PuPd_NOPULL;		//上下拉电阻:无上下拉电阻
	GPIO_Init(GPIOA, &GPIO_InitStructure);

	//选择引脚复用功能
	GPIO_PinAFConfig(GPIOA, GPIO_PinSource9, GPIO_AF_USART1);
	GPIO_PinAFConfig(GPIOA, GPIO_PinSource10, GPIO_AF_USART1);
	
	//配置串口相关属性
	USART_InitStructure.USART_BaudRate = 115200;						//波特率
	USART_InitStructure.USART_WordLength = USART_WordLength_8b;		//数据位
	USART_InitStructure.USART_StopBits = USART_StopBits_1;			//停止位
	USART_InitStructure.USART_Parity = USART_Parity_No;				//校验位
	USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;	//无流控
	USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;	//接收发送模式
	USART_Init(USART1, &USART_InitStructure);
		
	
	//配置串口的中断(数据接收触发中断)
	USART_ITConfig(USART1, USART_IT_RXNE, ENABLE);
	
	NVIC_InitStructure.NVIC_IRQChannel = USART1_IRQn;
	NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
	NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
	NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
	NVIC_Init(&NVIC_InitStructure);
	
	//串口1工作
	USART_Cmd(USART1,ENABLE);

}

/* 参数:要发送的字符串,要求字符串末尾以 \0 结尾 */
void send_string(char *arr)
{
	
	while(*arr)	//判断字符串是否结束
	{
		//通过串口1发送数据到PC
		USART_SendData(USART1, *arr++);
		while(USART_GetFlagStatus(USART1, USART_FLAG_TXE) == RESET);//等待发送数据完毕
	}
	
}

        uart.h

#ifndef _UART_H
#define _UART_H

//C文件中需要的其他的头文件
#include <stm32f4xx.h>


//C文件中定义的函数的声明
void UART1_Config(void);
void send_string(char *arr);

#endif

        uart3.c 

#include "uart3.h"
#include "delay.h"
#include "stdarg.h"
#include "stdio.h"
#include "string.h"
//#include "tim.h"

int i=0;
extern u8 Temperature_yu,Smog_yu,CO_yu;


//串口发送缓存区
__align(8) u8 USART3_TX_BUF[USART3_MAX_SEND_LEN];   //发送缓冲,最大USART3_MAX_SEND_LEN字节
#ifdef USART3_RX_EN                                //如果使能了接收
//串口接收缓存区
u8 USART3_RX_BUF [USART3_MAX_RECV_LEN];            //接收缓冲,最大USART3_MAX_RECV_LEN个字节.
//通过判断接收连续2个字符之间的时间差不大于100ms来决定是不是一次连续的数据.
//如果2个字符接收间隔超过100ms,则认为不是1次连续数据.也就是超过100ms没有接收到
//任何数据,则表示此次接收完毕.
//接收到的数据状态
//[15]:0,没有接收到数据;1,接收到了一批数据.
//[14:0]:接收到的数据长度

u16 USART3_RX_STA=0;

void USART3_IRQHandler(void)
{
	u8 res;
	int j,k,find;
	u8 get_data[11];
	char str_get_data[11];
	char* token;
	
	if(USART_GetITStatus(USART3,USART_IT_RXNE) != RESET)//接收到数据
	{
		res =USART_ReceiveData(USART3);
        if((USART3_RX_STA&(1<<15))==0)//接收完的一批数据,还没有被处理,则不再接收其他数据
		{
			if(USART3_RX_STA<USART3_MAX_RECV_LEN)//还可以接收数据
			{
				
				USART3_RX_BUF[USART3_RX_STA++]=res;
				
				// 判断接收到的数据是否为esp8266发送的数据
                if(res == '\n' && USART3_RX_BUF[USART3_RX_STA - 2] == '\r')
                {
                    // 提取接收缓存区中的数据并进行处理
					if(USART3_RX_BUF[0] == '\n' || USART3_RX_BUF[0] == '\r' ){} //舍弃换行符,以免输出空行
					else{
						if(i<47){	//过滤掉定义wifi模块时的返回值
							i++;
						}
						else{
							printf("串口3收到%s",USART3_RX_BUF);
//							printf("i = %d\n",i);

							/*寻找 USART3_RX_BUF 中的冒号*/
							for(j=0;j<20;j++){
								find = 0;
								if(USART3_RX_BUF[j] == ':')
								{
									find = 1;//找到后find = 1,退出循环
									break;
								}
							}
							
							if(find==1){
								for(k=0;k<10;k++){
									get_data[k] = USART3_RX_BUF[k+j];
								}
								printf("get_data%s\n",get_data);
								
								snprintf(str_get_data, sizeof(str_get_data), "%s", get_data);
								// 按空格分割字符串
								token = strtok(str_get_data, " ");
							
								if (token != NULL) {
																		
									// 第一个数值
									token = strtok(NULL, " ");
									if (token != NULL) {
										Temperature_yu = atoi(token);
            
										// 第二个数值
										token = strtok(NULL, " ");
										if (token != NULL) {
											Smog_yu = atoi(token);
											
											// 第三个数值
											token = strtok(NULL, " ");
											if (token != NULL){
												CO_yu = atoi(token);
											} else {
												// 如果没有第三个数值,可以给它赋一个默认值
												CO_yu = 20;
											}
										} else {
											// 如果没有第二个数值,可以给它赋一个默认值
											CO_yu = 20;
											}
									} else {
										// 如果没有任何数值,可以给它们都赋一个默认值
										Temperature_yu = 40;
										Smog_yu = 20;
										CO_yu = 20;
									}
								} else {
									// 如果没有任何数值,可以给它们都赋一个默认值
									Temperature_yu = 40;
									Smog_yu = 20;
									CO_yu = 20;
								}
							}
						}
					}
						
                    // 清空接收缓存区
                    USART3_RX_STA = 0;
                    memset(USART3_RX_BUF, 0, sizeof(USART3_RX_BUF));//用于清空接收缓存区USART3_RX_BUF,将其中的所有元素都设置为0
                }
			}
			else
			{
				USART3_RX_STA|=1<<15;
			}
		}
	}
}
#endif


void UART3_Config(void)
{
	NVIC_InitTypeDef NVIC_InitStructure;
    GPIO_InitTypeDef GPIO_InitStructure;
    USART_InitTypeDef USART_InitStructure;

	RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB,ENABLE);//使能GPIOB时钟
	RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART3,ENABLE);//使能USART3时钟
	
	USART_DeInit(USART3);
	
	GPIO_InitStructure.GPIO_Pin = GPIO_Pin_11 | GPIO_Pin_10;//GPIOB11和GPIOB10初始化
	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF ;//复用功能
    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;//速度50MHz
	GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;//推挽复用输出
	GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;//上拉
    GPIO_Init(GPIOB,&GPIO_InitStructure);//初始化GPIOB11,和GPIOB10

	GPIO_PinAFConfig(GPIOB,GPIO_PinSource11,GPIO_AF_USART3);//GPIOB11复用为USART3
	GPIO_PinAFConfig(GPIOB,GPIO_PinSource10,GPIO_AF_USART3);//GPIOB10复用为USART3

	
	USART_InitStructure. USART_BaudRate = 115200;//波特率
    USART_InitStructure.USART_WordLength = USART_WordLength_8b;//字长为8位数据格式
    USART_InitStructure.USART_StopBits = USART_StopBits_1;//一个停止位
    USART_InitStructure.USART_Parity = USART_Parity_No;//无奇偶校验位
    USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;//无硬件数据流控制
	USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;//收发模式

    USART_Init(USART3, &USART_InitStructure);//初始化串口3
    

    USART_ITConfig(USART3,USART_IT_RXNE,ENABLE);//开启中断
	
	NVIC_InitStructure.NVIC_IRQChannel = USART3_IRQn;
    NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority=0 ;//抢占优先级2
	NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;//子优先级3
	NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;//IRQ通道使能
    NVIC_Init(&NVIC_InitStructure);//根据指定的参数初始化VIC寄存器
//    TIM7_Config(1000-1,8400-1); //100ms中断
    USART3_RX_STA=0;//清零
    TIM_Cmd(TIM7,DISABLE);//关闭定时器7
	USART_Cmd (USART3,ENABLE);//使能串口

}

//串口3,printf 函数
//确保一次发送数据不超过USART3_MAX_SEND_LEN字节

void u3_printf(char* fmt, ...)
{
	u16 i,j;
	va_list ap;
	va_start(ap,fmt);
	vsprintf((char*)USART3_TX_BUF,fmt,ap);
	va_end(ap);
	i=strlen((const char*)USART3_TX_BUF);//此次发送数据的长度
	for(j=0;j<i;j++)//循环发送数据
	{
		while(USART_GetFlagStatus(USART3,USART_FLAG_TC)==RESET);//等待上次数据传输完成
		USART_SendData(USART3,(uint8_t)USART3_TX_BUF[j]);
	}
}

        uart3.h 

#ifndef _UART3_H
#define _UART3_H

//C文件中需要的其他的头文件
#include "sys.h"
#include <stm32f4xx.h>

#define USART3_MAX_RECV_LEN    500
#define USART3_MAX_SEND_LEN    500
#define USART3_RX_EN           1

extern u8 USART3_RX_BUF[USART3_MAX_RECV_LEN];
extern u8 USART3_TX_BUF[USART3_MAX_SEND_LEN];
extern u16 USART3_RX_STA;

void UART3_Config(void);
void TIM7_Int_Init(u16 arr,u16 psc);
void u3_printf(char* fmt, ...);

#endif

        esp8266.h

#ifndef _ESP8266_H
#define _ESP8266_H

//C文件中需要的其他的头文件
#include <stm32f4xx.h>
#include "sys.h"
#include "delay.h"
#include "uart3.h"
#include "uart.h"
#include "string.h"
#include <stdio.h>

extern char restart[];
extern char cwmode[];
extern char cwlap[];
extern char cwjap[];
extern char cifsr[];
extern char cipmux[];
extern char cipstart[];
extern char cipsend[];
extern char cipserver[];
extern char cwlif[];
extern char cipstatus[];
extern char cipsto[];
extern char cipmode[];
extern char test[];

u8 atk_8266_send_cmd(char *cmd,char *ack,u16 waittime);
u8* atk_8266_send_data(char *cmd,u16 waittime);
u8 atk_8266_check_cmd(char *str);
void atk_8266_start_trans(void);
u8 atk_8266_quit_trans(void);

#endif

        Main program

        main.c

#include <stm32f4xx.h>
#include "sys.h"
#include <stdio.h>
#include "delay.h"
#include "led.h"
#include "TIM.h"
#include "uart.h"
#include "uart3.h"
#include "DHT11.h"
#include "mq2.h"
#include "mq7.h"
#include "beep.h"
#include "key.h"
#include "esp8266.h"
#include "oled.h"


//重定向fputc函数
int fputc(int ch, FILE *F)
{
	//通过串口1发送数据到PC
	USART_SendData(USART1, ch);
	while(USART_GetFlagStatus(USART1, USART_FLAG_TXE) == RESET);//等待发送数据完毕
	
	return ch;
}

//阈值更改函数
void Yuzhi_change(u8 *yuzhi)
{
	if( PAin(0)== 0 )//s1按下
	{
		if( *yuzhi<99 )
		{
			PFout(9) = 0;//D1亮
			(*yuzhi)++;
		}
		
	}
	else
		PFout(9) = 1;//D1灭
	
	if( PEin(2)== 0 )//s2按下
	{
		if( *yuzhi>1 )
		{
			PFout(10) = 0;//D2亮
			(*yuzhi)--;
		}
		
	}
	else
		PFout(10) = 1;//D2灭
	
}


//更改需要调整哪个阈值
void Yuzhi_kind_change(u8 *kind, u8 *wendu_yu, u8 *yanwu_yu, u8 *CO_yu)
{
	switch(*kind)
	{
		case 1:Yuzhi_change(&*wendu_yu);break;
		case 2:Yuzhi_change(&*yanwu_yu);break;
		case 3:Yuzhi_change(&*CO_yu);break;
		default :break;
	}
	
	/*按键3实现下调*/
	if( PEin(3)== 0 )
	{
		PEout(13) = 0;
		if( *kind<3 )
			(*kind)++;
		else if( *kind == 3 )
			*kind = 1;
		
		switch(*kind)
		{
			case 1:Yuzhi_change(&*wendu_yu);break;
			case 2:Yuzhi_change(&*yanwu_yu);break;
			case 3:Yuzhi_change(&*CO_yu);break;
			default :break;
		}
		
	}
	else
		PEout(13) = 1;
	
	
	/*按键4实现上调
	if( PEin(4)== 0 )
	{
		PEout(14) = 0;
		if( *kind>1 )
			(*kind)--;
		
		switch(*kind)
		{
			case 1:Yuzhi_change(&*wendu_yu);break;
			case 2:Yuzhi_change(&*yanwu_yu);break;
			case 3:Yuzhi_change(&*CO_yu);break;
			default :break;
		}
	}
	else
		PEout(14) = 1;*/
	
}

void s4(int kind, char *str_shidu, char *str_temp, char *str_smog, char *str_co, char *str_temp_yu, char *str_smog_yu, char *str_co_yu, u8 quality)
{
	if( PEin(4)== 0 )
	{
		PEout(14) = 0;
		OLED_Clear();
		OLED_ShowChinese3(0,0,6,16);//空
		OLED_ShowChinese3(18,0,7,16);//气
		OLED_ShowChinese3(36,0,8,16);//质
		OLED_ShowChinese3(54,0,9,16);//量
		switch(quality)
		{
			case 1:
				OLED_ShowChinese3(72,0,10,16);//优
				OLED_Refresh();
				break;
			case 2:
				OLED_ShowChinese3(72,0,11,16);//良
				OLED_Refresh();
				break;
			case 3:
				OLED_ShowChinese3(72,0,12,16);//差
				OLED_Refresh();
				break;
			default :break;
		}
		
		OLED_ShowChinese3(0,16,0,16);//现
		OLED_ShowChinese3(18,16,1,16);//在
		OLED_ShowChinese3(36,16,2,16);//可
		OLED_ShowChinese3(54,16,3,16);//以
		OLED_ShowChinese3(72,16,4,16);//调
		OLED_ShowChinese3(90,16,5,16);//整
		
		switch(kind)
		{
			case 1:
				OLED_ShowChinese2(0,32,0,16);//温
				OLED_ShowChinese2(18,32,2,16);//度
				OLED_ShowChinese2(36,32,6,16);//阈
				OLED_ShowChinese2(54,32,7,16);//值
				OLED_Refresh();
				break;
			case 2:
				OLED_ShowString(0,32,"CH4",16);
				OLED_ShowChinese2(36,32,6,16);//阈
				OLED_ShowChinese2(54,32,7,16);//值
				OLED_Refresh();
				break;
			case 3:
				OLED_ShowString(0,32,"CO",16);
				OLED_ShowChinese2(36,32,6,16);//阈
				OLED_ShowChinese2(54,32,7,16);//值
				OLED_Refresh();
				break;
			default :break;
		}
		OLED_Refresh();
		
		
		delay_ms(1500);
		
		/********OLED部分*********/
		OLED_Clear();
		OLED_ShowChinese2(0,0,1,16);//湿
		OLED_ShowChinese2(18,0,2,16);//度
		OLED_ShowChar(36,0,':',16);//:
		OLED_ShowString(48,0,&*str_shidu,16);
		OLED_ShowChinese2(87,0,6,16);//阈
		OLED_ShowChinese2(105,0,7,16);//值
		
		OLED_ShowChinese2(0,16,0,16);//温
		OLED_ShowChinese2(18,16,2,16);//度
		OLED_ShowChar(36,16,58,16);//26号‘:’,ASC2为58
		OLED_ShowString(48,16,&*str_temp,16);
		OLED_ShowString(96,16,&*str_temp_yu,16);
		
		OLED_ShowString(0,32,"CH4:",16);
		OLED_ShowString(32,32,&*str_smog,16);
		OLED_ShowString(96,32,&*str_smog_yu,16);
		
		OLED_ShowString(0,48,"CO: ",16);
		OLED_ShowString(32,48,&*str_co,16);
		OLED_ShowString(96,48,&*str_co_yu,16);
		OLED_Refresh();
		
		PEout(14) = 1;
	}
	else
		PEout(14) = 1;
}

u8 kind = 1;
u8 Temperature_yu;//温度的阈值	
u8 Smog_yu;//Smog的阈值	
u8 CO_yu;//CO的阈值
u8 quality = 1;

/*用于存放测量结果*/
int result[] = {0, 0, 0, 0, 0, 0, 0};
char str[25];//要通过WiFi发送的字符

char str_shidu[10];
char str_temp[10];
char str_smog[10];
char str_co[10];
char str_temp_yu[10];
char str_smog_yu[10];
char str_co_yu[10];

extern u8 num1,num2,num3;


int main(void)
{
	uint8_t buf[5];//保存温湿度数值的数组
	float Smog_ppm = 0;
	float CO_ppm = 0;
	int i = 0;
	u8 ret=0,ret1=0;
	
	Temperature_yu = 40;
	Smog_yu = 20;
	CO_yu = 20;
	
	
	//确定系统定时器的工作频率  内核的工作频率/8 = 168MHz/8 = 21MHz
	SysTick_CLKSourceConfig(SysTick_CLKSource_HCLK_Div8);
	
	
	led_init();
	
	UART1_Config();//配置串口
	UART3_Config();
	
	MQ2_Init();
	
	CO_Init();//配置CO模块
	
	Key_Init();//配置4个按键
	
	Beep_init();//配置蜂鸣器
	
	OLED_Init();
	
	atk_8266_start_trans();
	
	
	while(1)
	{

		if(dht11_read_data(buf)==0){}
		
		Yuzhi_kind_change(&kind, &Temperature_yu, &Smog_yu, &CO_yu);
		s4(kind, str_shidu, str_temp, str_smog, str_co, str_temp_yu, str_smog_yu, str_co_yu, quality);
		
		Smog_ppm = Smog_GetPPM();
		CO_ppm = MQ7_GetPPM();
				
		/*通过WiFi发送数据部分*/
		result[0] = buf[0];//湿度
		result[1] = buf[2];//温度
		result[2] = (int)Smog_ppm;//烟雾浓度
		result[3] = (int)CO_ppm;//CO浓度
		result[4] = Temperature_yu;//温度阈值
		result[5] = Smog_yu;//烟雾阈值
		result[6] = CO_yu;//CO阈值
		
		sprintf(str, "%d", result[0]); // 将第一个整数转换为字符串
		for (i = 1; i < 7; i++) {
        sprintf(str + strlen(str), " %d", result[i]); // 将后面的整数添加到字符串中,并在前面加一个空格,str是目标字符串的地址,strlen(str)表示已经写入字符串str的字符数量
		}
		sprintf(str + strlen(str), " 0 0 0 0 0 0 0 0 0 0 0 0 0 0"); //在字符串末尾添加多个“ 0”以防止字符串的长度不足以输出
//		printf("%s\n", str); //输出结果
		ret = atk_8266_send_cmd("AT+CIPSEND=0,21",NULL,200);
		if(ret == 0 ) 
		{
			delay_ms(1000);
			ret1 = atk_8266_send_cmd(str, NULL, 200);
			if(ret1 == 0 ) printf("SEND OK\n");
			else printf("SEND fail\n");
		}
		else printf("AT+CIPSEND fail\n");
		memset(str, 0, sizeof(str));//清空str
		

		
		
		/*空气质量判断*/
		if( CO_ppm<25 && Smog_ppm<25 && buf[2]<25 )
		{
			quality  = 1;
		}
		else if( CO_ppm>35 || Smog_ppm>35 || buf[2]>35 )
		{
			quality = 3;
		}
		else quality = 2;
		
		/*报警系统*/
		if( (CO_ppm >= CO_yu) || (Smog_ppm >= Smog_yu ) || (buf[2]>=Temperature_yu) )
			PFout(8) = 1;//蜂鸣器叫		
		else
			PFout(8) = 0;
		
		
		sprintf(str_shidu,"%d",buf[0]);//把整型的湿度转化为字符串,供oled输出
		sprintf(str_temp,"%d",buf[2]);//把整型的温度转化为字符串,供oled输出
		sprintf(str_temp_yu,"%d",Temperature_yu);//把整型的温度阈值转化为字符串,供oled输出
		sprintf(str_smog_yu,"%d",Smog_yu);//把整型的烟雾阈值转化为字符串,供oled输出
		sprintf(str_co_yu,"%d",CO_yu);//把整型的CO阈值转化为字符串,供oled输出
		sprintf(str_smog,"%.2f",Smog_ppm);//把浮点型的烟雾浓度转化为字符串,供oled输出
		sprintf(str_co,"%.2f",CO_ppm);//把浮点型的CO浓度转化为字符串,供oled输出
		
		/********OLED部分*********/
		OLED_Clear();
		OLED_ShowChinese2(0,0,1,16);//湿
		OLED_ShowChinese2(18,0,2,16);//度
		OLED_ShowChar(36,0,':',16);//:
		OLED_ShowString(48,0,str_shidu,16);
		OLED_ShowChinese2(87,0,6,16);//阈
		OLED_ShowChinese2(105,0,7,16);//值
		OLED_ShowChinese2(0,16,0,16);//温
		OLED_ShowChinese2(18,16,2,16);//度
		OLED_ShowChar(36,16,58,16);//26号‘:’,ASC2为58
		OLED_ShowString(48,16,str_temp,16);
		OLED_ShowString(96,16,str_temp_yu,16);
		OLED_ShowString(0,32,"CH4:",16);
		OLED_ShowString(32,32,str_smog,16);
		OLED_ShowString(96,32,str_smog_yu,16);
		OLED_ShowString(0,48,"CO: ",16);
		OLED_ShowString(32,48,str_co,16);
		OLED_ShowString(96,48,str_co_yu,16);
		OLED_Refresh();
//		
		
		
//		delay_ms(5000);
		
	}
	
	
	return 0;
}

void USART1_IRQHandler(void)
{
	uint8_t d;
	//检测是否接收都数据
	if(USART_GetITStatus(USART1, USART_IT_RXNE) != RESET)
	{
		//读取串口1接收PC发送的数据
		d = USART_ReceiveData(USART1);
		
		
	}
}

        key.c

#include "key.h"

void Key_Init()
{
	GPIO_InitTypeDef  GPIO_InitStructure;

	/*四个按键*/
	/* GPIOA 引脚的时钟使能  */
	RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);	
	
	/* 配置PA0引脚为输出模式 s1*/
	GPIO_InitStructure.GPIO_Pin 	= GPIO_Pin_0;			//配置的引脚
	GPIO_InitStructure.GPIO_Mode 	= GPIO_Mode_IN;		//输入模式
	GPIO_InitStructure.GPIO_OType 	= GPIO_OType_PP;		//推挽模式
	GPIO_InitStructure.GPIO_Speed 	= GPIO_Speed_100MHz;	//速度为100MHz
	GPIO_InitStructure.GPIO_PuPd 	= GPIO_PuPd_NOPULL;		//上下拉电阻:无上下拉电阻
	GPIO_Init(GPIOA, &GPIO_InitStructure);
	
	/* 配置PE2引脚为输出模式 s2*/
	GPIO_InitStructure.GPIO_Pin 	= GPIO_Pin_2;			//配置的引脚
	GPIO_InitStructure.GPIO_Mode 	= GPIO_Mode_IN;		//输入模式
	GPIO_InitStructure.GPIO_OType 	= GPIO_OType_PP;		//推挽模式
	GPIO_InitStructure.GPIO_Speed 	= GPIO_Speed_100MHz;	//速度为100MHz
	GPIO_InitStructure.GPIO_PuPd 	= GPIO_PuPd_NOPULL;		//上下拉电阻:无上下拉电阻
	GPIO_Init(GPIOE, &GPIO_InitStructure);
	
	/* 配置PE3引脚为输出模式 s3*/
	GPIO_InitStructure.GPIO_Pin 	= GPIO_Pin_3;			//配置的引脚
	GPIO_InitStructure.GPIO_Mode 	= GPIO_Mode_IN;		//输入模式
	GPIO_InitStructure.GPIO_OType 	= GPIO_OType_PP;		//推挽模式
	GPIO_InitStructure.GPIO_Speed 	= GPIO_Speed_100MHz;	//速度为100MHz
	GPIO_InitStructure.GPIO_PuPd 	= GPIO_PuPd_NOPULL;		//上下拉电阻:无上下拉电阻
	GPIO_Init(GPIOE, &GPIO_InitStructure);
	
	/* 配置PE4引脚为输出模式 s4*/
	GPIO_InitStructure.GPIO_Pin 	= GPIO_Pin_4;			//配置的引脚
	GPIO_InitStructure.GPIO_Mode 	= GPIO_Mode_IN;		//输入模式
	GPIO_InitStructure.GPIO_OType 	= GPIO_OType_PP;		//推挽模式
	GPIO_InitStructure.GPIO_Speed 	= GPIO_Speed_100MHz;	//速度为100MHz
	GPIO_InitStructure.GPIO_PuPd 	= GPIO_PuPd_NOPULL;		//上下拉电阻:无上下拉电阻
	GPIO_Init(GPIOE, &GPIO_InitStructure);

}

        key.h

#ifndef _KEY_H
#define _KEY_H

//C文件中需要的其他的头文件
#include <stm32f4xx.h>
#include "sys.h"
#include "delay.h"
#include "math.h"
#include "adc.h"


//C文件中定义的函数的声明
void Key_Init(void);

#endif

        led.c

#include "led.h"


void led_init(void)
{
	GPIO_InitTypeDef GPIO_InitStructure;
	
	//1、初始化led对应的引脚 PF9 PF10 PE13 PE14的时钟
	RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOE|RCC_AHB1Periph_GPIOF, ENABLE);
	
	//2、通过结构体初始化led引脚
	/* 配置PF9 PF10引脚为输出模式 */
	GPIO_InitStructure.GPIO_Pin 	= GPIO_Pin_9 | GPIO_Pin_10;			//配置的引脚
	GPIO_InitStructure.GPIO_Mode 	= GPIO_Mode_OUT;		//输出模式
	GPIO_InitStructure.GPIO_OType 	= GPIO_OType_PP;		//推挽模式
	GPIO_InitStructure.GPIO_Speed 	= GPIO_Speed_100MHz;	//速度为100MHz
	GPIO_InitStructure.GPIO_PuPd 	= GPIO_PuPd_NOPULL;		//上下拉电阻:无上下拉电阻
	GPIO_Init(GPIOF, &GPIO_InitStructure);

	/* 配置PE13 PE14引脚为输出模式 */
	GPIO_InitStructure.GPIO_Pin 	= GPIO_Pin_13 | GPIO_Pin_14;			//配置的引脚
	GPIO_Init(GPIOE, &GPIO_InitStructure);
	
	PFout(9) = 1;
	PFout(10) = 1;
	PEout(13) = 1;
	PEout(14) = 1;
}

extern uint8_t cmp_led1;	//全局变量的声明,说明该全局变量在其他文件中

void LED_CTL(u8 num, u8 stat, u8 value)
{
	if(stat == 0xFF)	//打开
	{
		if(num == 0x01)
			TIM_SetCompare1(TIM14, 0);	//占空比为0, 常亮
		if(num == 0x02)
			cmp_led1 = 0;				//占空比为0, 常亮
		if(num == 0x03)
			TIM_SetCompare3(TIM1, 0);	//占空比为0, 常亮
		if(num == 0x04)
			TIM_SetCompare4(TIM1, 0);	//占空比为0, 常亮
		
	}
	else if(stat == 0x00) //关闭
	{
		if(num == 0x01)
			TIM_SetCompare1(TIM14, 100);	//占空比为100, 常灭
		if(num == 0x02)
			cmp_led1 = 100;				//占空比为100, 常灭
		if(num == 0x03)
			TIM_SetCompare3(TIM1, 100);	//占空比为100, 常灭
		if(num == 0x04)
			TIM_SetCompare4(TIM1, 100);	//占空比为100, 常灭
	}
	else if(stat == 0xAF) //亮度控制
	{
		if(value<100 && value>0)
		{
			if(num == 0x01)
				TIM_SetCompare1(TIM14, value);	
			if(num == 0x02)
				cmp_led1 = value;				
			if(num == 0x03)
				TIM_SetCompare3(TIM1, value);	
			if(num == 0x04)
				TIM_SetCompare4(TIM1, value);	
		}
	}
}

         led.h

#ifndef _LED_H
#define _LED_H

//C文件中需要的其他的头文件
#include <stm32f4xx.h>
#include "sys.h"

//C文件中定义的函数的声明
void led_init(void);
void LED_CTL(u8 num, u8 stat, u8 value);

#endif

        beep.c

#include "beep.h"

void Beep_init()
{
	GPIO_InitTypeDef GPIO_InitStructure;
	
	RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOF,ENABLE);//使能PF的时钟

	GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8;//PF8引脚
	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;//输出模式	
	GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;//推挽模式
	GPIO_InitStructure.GPIO_Speed = GPIO_Low_Speed;//低俗
	GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;//上下拉电阻:无上下拉电阻
	GPIO_Init(GPIOF, &GPIO_InitStructure);

	PFout(8) = 0;//不准叫
}

        beep.h

#ifndef _BEEP_H
#define _BEEP_H

//C文件中需要的其他的头文件
#include <stm32f4xx.h>
#include "sys.h"
#include "delay.h"


//C文件中定义的函数的声明
void Beep_init(void);

#endif

Guess you like

Origin blog.csdn.net/nazonomaster/article/details/130043771