Initial commit
This commit is contained in:
33
src/main.c
Normal file
33
src/main.c
Normal file
@@ -0,0 +1,33 @@
|
||||
#include <esp_log.h>
|
||||
|
||||
#include "bme280.h"
|
||||
#include "events.h"
|
||||
#include "i2c.h"
|
||||
#include "wifi.h"
|
||||
|
||||
#define TAG "main"
|
||||
|
||||
void app_main() {
|
||||
ESP_LOGW(TAG, "helloooooooo");
|
||||
|
||||
setupEvents();
|
||||
|
||||
// wifiInit("204", "31415926");
|
||||
// wifiStart();
|
||||
|
||||
i2cInitMasterBus(4, 15);
|
||||
|
||||
struct BME280 bme;
|
||||
|
||||
BME280Init(&bme, OVSP_X1);
|
||||
|
||||
for (;;) {
|
||||
struct BME280Reading reading = BME280Read(&bme);
|
||||
|
||||
ESP_LOGW(TAG, "HEY THE TEMPERATURE IS %f °C", reading.tempC);
|
||||
ESP_LOGW(TAG, "HEY THE HUMIDITY IS %f %%", reading.humidity);
|
||||
ESP_LOGW(TAG, "HEY THE PRESSURE IS %f hPa\n", reading.pressurehPa);
|
||||
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user