初级会员

- 积分
- 86
- 金钱
- 86
- 注册时间
- 2016-9-7
- 在线时间
- 19 小时
|

楼主 |
发表于 2021-1-7 20:53:52
|
显示全部楼层
本帖最后由 令界剑 于 2021-1-7 20:56 编辑
oh,no图和文字怎么都不见了。是这样的,我用潘多拉的板子做的实验,例程是温湿度的那个,实际效果只能显示一半,不知道为什么
效果
图片数据
使用的函数
图片设置
- int main(void)
- {
- u8 t = 0;
- float temperature, humidity;
- HAL_Init();
- SystemClock_Config(); //初始化系统时钟为80M
- delay_init(80); //初始化延时函数 80M系统时钟
- uart_init(115200); //初始化串口,波特率为115200
- LED_Init(); //初始化LED
- KEY_Init(); //初始化按键
- LCD_Init(); //初始化LCD
- // POINT_COLOR = RED;
- //Display_ALIENTEK_LOGO(0, 0);
- LCD_Show_Image(0,0,240,120,gImage_tou);
- // LCD_Show_Image(0,0,16,16,zi);
- // LCD_ShowString(30, 145, 200, 16, 16, "2021/01/07");
- // while(AHT10_Init()) //初始化AHT10
- // {
- // LCD_ShowString(30, 170, 200, 16, 16, "AHT10 Error");
- // delay_ms(200);
- // LCD_Fill(30, 170, 239, 170 + 16, WHITE);
- // delay_ms(200);
- // }
- // LCD_ShowString(30, 170, 200, 16, 16, "AHT10 OK");
- // POINT_COLOR = BLUE; //设置字体为蓝色
- // LCD_ShowString(30, 190, 200, 16, 16, "Temp: . C");
- // LCD_ShowString(30, 210, 200, 16, 16, "Humi: . %RH");
- while(1)
- {
- // if(t % 10 == 0) //每100ms读取一次
- // {
- // temperature = AHT10_Read_Temperature();
- // humidity = AHT10_Read_Humidity();
- // if(temperature < 0)
- // {
- // LCD_ShowChar(30 + 40, 190, '-', 16); //显示负号
- // temperature = -temperature; //转为正数
- // }
- // else
- // LCD_ShowChar(30 + 40, 190, ' ', 16); //去掉负号
- // LCD_ShowNum(30 + 48, 190, temperature, 2, 16); //显示温度整数
- // LCD_ShowNum(30 + 72, 190, (u32)(temperature * 10) % 10, 1, 16); //显示温度小数
- // LCD_ShowNum(30 + 48, 210, humidity, 2, 16); //显示湿度整数
- // LCD_ShowNum(30 + 72, 210, (u32)(humidity * 10) % 10, 1, 16); //显示湿度小数
- // }
- delay_ms(10);
- t++;
- if(t == 20)
- {
- t = 0;
- LED_B_TogglePin; //程序运行指示灯
- }
- }
- }
复制代码
|
|