fix sensor type detection

This commit is contained in:
Syping 2021-04-23 13:19:34 +02:00
parent b48eda46de
commit dc073edd01

View file

@ -8,7 +8,7 @@ int getdhtstring(int PIN, char* string)
float humid;
float temp;
while (1) {
if (pi_2_dht_read(PIN, PIN, &humid, &temp) == DHT_SUCCESS) {
if (pi_2_dht_read(DHT22, PIN, &humid, &temp) == DHT_SUCCESS) {
sprintf(string, "{\"humidity\": %.1f, \"temp\": %.1f}", humid, temp);
break;
}