Explorar el Código

añadido 10% error en tiempo

dacowars hace 1 mes
padre
commit
d1d373a08d
Se han modificado 1 ficheros con 3 adiciones y 3 borrados
  1. 3 3
      main/main.c

+ 3 - 3
main/main.c

@@ -59,9 +59,9 @@ static inline esp_err_t dht_communication(gpio_num_t pin, uint32_t *data){
     esp_rom_delay_us(1500); // Pull low for at least 1ms
     gpio_set_level(pin, 1); // Release the line
 
-    CHECK_LOGE(get_change_time(pin, 40, 1, &low_time), "Failed to get dht response"); // Wait for the sensor to pull low 20-40us
-    CHECK_LOGE(get_change_time(pin, 80, 0, &high_time), "Failed to get dht response"); // Wait for the sensor to pull high 80us
-    CHECK_LOGE(get_change_time(pin, 80, 1, &low_time), "Failed to get dht response"); // Wait for the sensor to pull low 80us
+    CHECK_LOGE(get_change_time(pin, 44, 1, &low_time), "Failed to get dht response"); // Wait for the sensor to pull low 20-40us
+    CHECK_LOGE(get_change_time(pin, 88, 0, &high_time), "Failed to get dht response"); // Wait for the sensor to pull high 80us
+    CHECK_LOGE(get_change_time(pin, 88, 1, &low_time), "Failed to get dht response"); // Wait for the sensor to pull low 80us
 
     for (uint8_t i = DHT_DATA_BITS; i > 0; i--){