Page 211 - 최강 아두이노 퍼스트 참고서
P. 211
default:
Serial.print("Unknwon error,\t");
break;
}
if(chk==DHTLIB_OK)
{
t=DHT.temperature;
h=DHT.humidity;
}
}
void loop()
{
int temp, humidity;
int ret=getDHT(temp,humidity);
if(ret != DHTLIB_OK)
{
lcd.setCursor(0,0);
lcd.print("Temp==error");
lcd.setCursor(0,1);
lcd.print("Humidity==error");
}
else
{
lcd.setCursor(0,0);
lcd.print("Temp=");
lcd.print(temp);
lcd.print(" *C");
lcd.setCursor(0,1);
lcd.print("Humidity=");
lcd.print(humidity);
lcd.print("% ");
delay(500);
}
}
211