1
0
Weather_ESP/main/main.c

40 lines
930 B
C
Raw Normal View History

#include "display.h"
#include "sensors.h"
#include "wifi.h"
#include "server.h"
#include "clock.h"
#include <esp_log.h>
void app_main(void)
{
int32_t temp = -12;
uint32_t pressure = 0;
uint32_t humidity = 0;
int32_t temp2 = 0;
uint32_t pressure2 = 0;
uint32_t humidity2 = 0;
time_str_t time;
init_sensors();
init_display();
init_wifi_sta();
init_server();
init_clock();
/* Draw the whole screen one time */
get_time(&time);
read_sensor(&temp, &pressure, &humidity);
read_sensor2(&temp2, &pressure2, &humidity2);
display_data(temp, pressure, humidity, temp2, pressure2, humidity2, time);
while (1) {
get_time(&time);
read_sensor(&temp, &pressure, &humidity);
read_sensor2(&temp2, &pressure2, &humidity2);
server_set_values(temp, pressure, humidity, temp2, pressure2, humidity2);
update_data(temp, pressure, humidity, temp2, pressure2, humidity2, time);
2020-04-21 03:18:39 +02:00
vTaskDelay(500 / portTICK_PERIOD_MS);
}
2020-02-03 09:02:25 +01:00
}