Added and integrated bmp280 temperature sensor
This commit is contained in:
+26
-1
@@ -34,6 +34,7 @@
|
||||
#include "uart.h"
|
||||
|
||||
// Platform includes
|
||||
#include "bmp280.h"
|
||||
#include "isl29125.h"
|
||||
#include "logger.h"
|
||||
#include "ledmatrix.h"
|
||||
@@ -80,6 +81,7 @@
|
||||
|
||||
static TaskHandle_t loggerTaskHandle;
|
||||
static TaskHandle_t otaTaskHandle;
|
||||
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// Function declarations
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
@@ -87,6 +89,8 @@ static TaskHandle_t otaTaskHandle;
|
||||
void loggerTask(void* parameters);
|
||||
void otaTask(void* parameters);
|
||||
|
||||
static void otaCallback(int value);
|
||||
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// Function definitions
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
@@ -142,7 +146,7 @@ extern "C" void app_main(void)
|
||||
//
|
||||
|
||||
// logger debugLogger = logger(16, uartDebug);
|
||||
logger debugLogger = logger(16, esplogger);
|
||||
logger debugLogger = logger(20, esplogger);
|
||||
// Call the logger executable within a dedicated task and forget about it afterwards
|
||||
xTaskCreate(loggerTask, (const char*)"loggerTask", 3000, &debugLogger, 3, &loggerTaskHandle);
|
||||
|
||||
@@ -193,6 +197,21 @@ extern "C" void app_main(void)
|
||||
// struct isl29125::rgb_t rgbValue;
|
||||
// rgbSensor.getRGB(&rgbValue);
|
||||
|
||||
// // -----------------------------------------------------------------------------------------------------------------
|
||||
// // I2C RGB Sensor on I2C MasterBus for sensors
|
||||
// //
|
||||
// bmp280 tempSensor = bmp280(0x76, i2cSensor);
|
||||
// // Reset the sensor
|
||||
// tempSensor.resetSensor();
|
||||
// // Make sure to apply a wait cycle between reset and continuous use - 2ms is advised as minimum
|
||||
// vTaskDelay(10);
|
||||
// // Initialize the BMP280
|
||||
// tempSensor.initialize();
|
||||
// // Set the temperature Oversampling
|
||||
// tempSensor.setSensorTemperatureOversampling(bmp280::BMP280_Oversampling_t::X1);
|
||||
// // Set the sensor to NORMAL mode
|
||||
// tempSensor.setSensorMode(bmp280::BMP280_Mode_t::NORMAL);
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Wifi create and connect
|
||||
//
|
||||
@@ -231,6 +250,7 @@ extern "C" void app_main(void)
|
||||
// OTA handler
|
||||
//
|
||||
ota otaUpdater = ota();
|
||||
otaUpdater.usCallback = otaCallback;
|
||||
// Call the OTA executable within a dedicated task and forget about it afterwards
|
||||
xTaskCreate(otaTask, (const char*)"OTATask", 4000, &otaUpdater, 3, &otaTaskHandle);
|
||||
|
||||
@@ -276,3 +296,8 @@ void otaTask(void* parameters)
|
||||
vTaskDelay(otaHandler->checkInterval_ms);
|
||||
}
|
||||
}
|
||||
|
||||
void otaCallback(int value)
|
||||
{
|
||||
LOGGER_WARNING("Current OTA value is %i", value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user