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-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-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-21 02:58:18 +02:00
|
|
|
wifi_init_sta();
|
|
|
|
init_server();
|
|
|
|
|
2020-02-10 19:14:18 +01:00
|
|
|
while (1) {
|
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-20 05:19:42 +02:00
|
|
|
display_data(temp, pressure, humidity, temp2, pressure2, humidity2);
|
|
|
|
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
2020-02-10 19:14:18 +01:00
|
|
|
}
|
2020-02-03 09:02:25 +01:00
|
|
|
}
|
|
|
|
|