高中生
最后登录1970-1-1
在线时间 小时
注册时间2015-3-20
|
最近调一个程序,可以用LCD 触摸来实现SD卡上不同的BMP图片在屏幕上显示,但是我在主界面还有显示汉字及字符,经常出现死机问题,要么突然不显示汉字了,要么触摸屏无响应了,这是怎么回事啊???????????????????求大神。
- int main(void)
- {
- LCD_Init(); //¡¾òѾ-ÑéÖ¤¡¿LCD_Init()oˉêyóëÏ·½USART1_Config()oˉêy½»»»Ö′DDË3DòD§1û¾ùá¼oÃ
- USART1_Config(); //2¢2»′æÔúLCD_Init()±ØDë·ÅÔúUSART1_Config()Ç°ÃæLCD2ÅÄüÕyè·ÏÔê¾μÄÇé¿ö£¬μ«Ö®Ç°μÄàú3ìè′′æÔúÕaÑùμÄÇé¿ö¡£
- Sd_fs_init();
- SysTick_Init();
- SPI_FLASH_Init();
- Touch_Init();
- DHT11_GPIO_Config();
- lilei_ADC1_Init();
- lilei_TIM3_PWM_Init();
-
- //exti_hongwai_PD3_Config(); //′Ëá½oˉêyËùᬽóòy½ÅóëLCD_Init()oˉêyòy½ÅÅäÖÃ3åí»áË(Öظ′ê1óÃáË)
- //baojing_led_beep_config(); //1êμ¼ÖÂLCD2»ÄüÕyè·ÏÔê¾
-
-
- lilei_start_touch_flash();
-
-
- Lcd_show_bmp(0, 0,"/__zhujiemian.bmp");
- Lcd_GramScan(2);
- lilei_TIM6_Configuiation();
-
-
-
- while(1)
- {
-
-
-
- lilei_value_filter();
- lilei_lcd_value_process();
-
-
-
-
-
-
-
-
-
-
-
- // printf("AD= %f V ",flame);
- // printf("\r\n");
- //
- //
- // Delay(0xffffee/4);
- //
-
-
-
-
-
-
-
- if(__x1==0 && __x2==0)
- {
- //if(DHT11_flag==1)
- // {
- if( Read_DHT11(&DHT11_Data)==SUCCESS)
- {
- if(__x1==0 && __x2==0)
- {
- LCD_DisNum(64+48, 71+2, DHT11_Data.humi_int, BLACK);
- LCD_DispChar(76+48, 71+2, '.', BLACK);
- LCD_DisNum(82+48, 71+2, DHT11_Data.humi_deci, BLACK);
- LCD_DispStr(82+48+6, 71+2, (uint8_t *)"%", BLACK);
- LCD_DisNum(82+30, 53+2, DHT11_Data.temp_int, BLACK);
- LCD_DispChar(94+30, 53+2, '.', BLACK);
- LCD_DisNum(100+30, 53+2, DHT11_Data.temp_deci, BLACK);
-
- if(DHT11_Data.temp_int>10 && DHT11_Data.temp_int<35)
- {
- LCD_DispStrCH(180,53,(uint8_t*)"Õy3£",BLACK);
- }
- else
- {
- if(DHT11_Data.temp_int<10)
- {
- LCD_DispStrCH(180,53,(uint8_t*)"μíÎÂ",RED);
- }
- else
- {
- if(DHT11_Data.temp_int>35)
- {
- LCD_DispStrCH(180,53,(uint8_t*)"¸ßÎÂ",RED);
- }
- }
- }
-
- if(DHT11_Data.humi_int>10 && DHT11_Data.humi_int<50)
- {
- LCD_DispStrCH(180,53+16+2,(uint8_t*)"Õy3£",BLACK);
- }
- else
- {
- if(DHT11_Data.humi_int<10)
- {
- LCD_DispStrCH(180,53+16+2,(uint8_t*)"¸éÔï",RED);
- }
- else
- {
- if(DHT11_Data.humi_int>50)
- {
- LCD_DispStrCH(180,53+16+2,(uint8_t*)"3±êa",RED);
- }
- }
- }
-
-
-
-
- }
-
- }
-
-
- if(__x1==0 && __x2==0)
- {
- if(flame>1.2)
- {
- LCD_DispEnCh(64+48,161,(uint8_t*)"ÎTÃ÷»e ",BLACK);
- LCD_DispStrCH(180,161,(uint8_t*)"Õy3£",BLACK);
-
- }
- else
- {
- if(flame>0 && flame<1.2)
- {
- LCD_DispStrCH(64+48,161,(uint8_t*)"¼ì2aμ½»e",BLACK);
- LCD_DispStrCH(180,161,(uint8_t*)"¾ˉ¸æ",RED);
- }
- }
-
-
- }
-
-
-
-
-
-
-
-
- //DHT11_flag=0;
- // }
-
-
-
-
-
-
- }
复制代码
}
}
|
|