高中生
最后登录1970-1-1
在线时间 小时
注册时间2015-1-7
|
发表于 2015-4-30 12:38:48
|
显示全部楼层
int main(void)
{
USART1_Config();
USART2_Config();
SysTick_Init();
USERGPIO_Config();
LCD_Init();
LCD_Clear(0, 0, 240, 320, BACKGROUND);
while (1)
{
if(GPIO_ReadInputDataBit(GPIOC,GPIO_Pin_9) == 0 && m==0)
{
LCD_DispStr(10, 90, (uint8_t *)"KID IS CRYING", WHITE);
sim900a_sms((char *)num,"KID IS CRYING");
m=1;
}
else if(GPIO_ReadInputDataBit(GPIOC,GPIO_Pin_9) == 1)
{
m=0;
}
if( Read_DHT11(&DHT11_Data)==SUCCESS)
{
LCD_DispStr(10, 110, (uint8_t *)"humidity:", WHITE);
LCD_DisNum(64, 110, DHT11_Data.humi_int, WHITE);
LCD_DispStr(10, 130, (uint8_t *)"temperature:", WHITE);
LCD_DisNum(82, 130, DHT11_Data.temp_int, WHITE);
}
else
{
LCD_DispStr(10, 110, (uint8_t *)"Read DHT11 ERROR", WHITE);
}
}
程序是这样的 |
|