可显示温湿度和空气质量
单片机源程序如下:
- #include "delay.h"
- #include "sys.h"
- #include "lcd.h"
- #include "led.h"
- #include "gui.h"
- #include "test.h"
- #include "adc.h"
- #include "key.h"
- #include "bsp_dht11.h"
- int main(void)
- {
- // uint8_t key;
- SystemInit();//初始化RCC 设置系统主频为72MHZ
- delay_init(72); //延时初始化
- LCD_Init(); //液晶屏初始化
- KEY_Init();
- DHT11_GPIO_Config();//初始化dht11
- ADC_Configuration(); //ADC初始化设置
- LED_Init();
- Demo_Menu();
- while(1)
- {
- // key=KeyScan();
- if(key1==0)
- {
-
- LCD_Clear(WHITE);//清屏
- Pic_test1();
- delay_ms(2000);
- Test_LED3();
- }
- if(key2==0)
- {
-
- LCD_Clear(WHITE);//清屏
- Demo_Menu();//演示程序
-
- }
- if(key3==0)
- {
- LCD_Clear(BLACK);//清屏
- Test_DHT11();
-
- }
- if(key4==0)
- {
- LCD_Clear(BLACK);//清屏
- Pic_test2();
- Test_LED2();
-
- }
-
- if(key5==0)
- {
- LCD_Clear(WHITE);//清屏
- Pic_xunhaun();
-
- }
- }
- }
复制代码
所有资料51hei提供下载:
电子相册源码.7z
(864.44 KB, 下载次数: 18)
|