/** * TODO file description */ #include #include #include #include "meteo_task.h" #include "ds18b20.h" #include "dht.h" #include "driver/gpio.h" void meteo_task(void* pvParameters) { // Try to unfuck GPIOs PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDI_U, FUNC_GPIO12); PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTCK_U, FUNC_GPIO13); PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTMS_U, FUNC_GPIO14); PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDO_U, FUNC_GPIO15); float dht_hum, dht_temp, ds_temp; while (1) { // this works ... ds_temp = ds18b20_measure_and_read(0, DS18B20_ANY); if (ds_temp != ds_temp) { // NAN printf("Fail to read temp\n"); } else { printf("Dallas: %f °C\n", ds_temp); } if (dht_read_float_data(DHT_TYPE_DHT11, 12, &dht_hum, &dht_temp)) { printf("DHT: %f °C, %f %%r.H\n", dht_temp, dht_hum); } vTaskDelay(pdMS_TO_TICKS(1000)); } vTaskDelete(NULL); }