2020-04-21 00:37:16 +02:00
|
|
|
|
2020-04-20 05:19:42 +02:00
|
|
|
#include "display.h"
|
2020-04-21 00:37:16 +02:00
|
|
|
#include "sensors.h"
|
2020-04-21 02:58:18 +02:00
|
|
|
#include "wifi.h"
|
|
|
|
#include "server.h"
|
2020-04-24 01:49:31 +02:00
|
|
|
#include "clock.h"
|
2020-02-10 19:14:18 +01:00
|
|
|
#include <esp_log.h>
|
2020-04-20 18:54:01 +02:00
|
|
|
|
2020-02-17 09:04:52 +01:00
|
|
|
void app_main(void)
|
|
|
|
{
|
2020-04-20 05:19:42 +02:00
|
|
|
int32_t temp = -12;
|
2020-02-17 09:04:52 +01:00
|
|
|
uint32_t pressure = 0;
|
|
|
|
uint32_t humidity = 0;
|
2020-03-05 01:30:31 +01:00
|
|
|
int32_t temp2 = 0;
|
|
|
|
uint32_t pressure2 = 0;
|
|
|
|
uint32_t humidity2 = 0;
|
2020-04-24 01:49:31 +02:00
|
|
|
time_str_t time;
|
2020-02-17 09:04:52 +01:00
|
|
|
|
2020-04-21 00:37:16 +02:00
|
|
|
init_sensors();
|
2020-04-20 05:19:42 +02:00
|
|
|
init_display();
|
2020-04-24 01:49:31 +02:00
|
|
|
init_wifi_sta();
|
2020-04-21 02:58:18 +02:00
|
|
|
init_server();
|
2020-04-24 01:49:31 +02:00
|
|
|
init_clock();
|
2020-04-21 02:58:18 +02:00
|
|
|
|
2020-04-24 01:49:31 +02:00
|
|
|
/* 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);
|
2020-02-10 19:14:18 +01:00
|
|
|
while (1) {
|
2020-04-24 01:49:31 +02:00
|
|
|
get_time(&time);
|
2020-04-21 00:37:16 +02:00
|
|
|
read_sensor(&temp, &pressure, &humidity);
|
|
|
|
read_sensor2(&temp2, &pressure2, &humidity2);
|
2020-04-21 02:58:18 +02:00
|
|
|
server_set_values(temp, pressure, humidity, temp2, pressure2, humidity2);
|
2020-04-24 01:49:31 +02:00
|
|
|
update_data(temp, pressure, humidity, temp2, pressure2, humidity2, time);
|
2020-04-21 03:18:39 +02:00
|
|
|
vTaskDelay(500 / portTICK_PERIOD_MS);
|
2020-02-10 19:14:18 +01:00
|
|
|
}
|
2020-02-03 09:02:25 +01:00
|
|
|
}
|
|
|
|
|