diff --git a/sensebox-bike-atrai-v2-esp32s3/src/display/Display.cpp b/sensebox-bike-atrai-v2-esp32s3/src/display/Display.cpp index 1a64e56..004050a 100644 --- a/sensebox-bike-atrai-v2-esp32s3/src/display/Display.cpp +++ b/sensebox-bike-atrai-v2-esp32s3/src/display/Display.cpp @@ -112,7 +112,7 @@ void SBDisplay::showSystemStatus() display.print(batteryCharge, 1); display.println(" %"); - drawBattery(0, 0, 16, 4); + // drawBattery(0, 0, 16, 4); display.display(); } diff --git a/sensebox-bike-atrai-v2-esp32s3/src/main.cpp b/sensebox-bike-atrai-v2-esp32s3/src/main.cpp index 31802e0..bedd412 100644 --- a/sensebox-bike-atrai-v2-esp32s3/src/main.cpp +++ b/sensebox-bike-atrai-v2-esp32s3/src/main.cpp @@ -12,14 +12,14 @@ DustSensor dustSensor; TempHumiditySensor tempHumiditySensor; DistanceSensor distanceSensor; AccelerationSensor accelerationSensor; -// BatterySensor batterySensor; +BatterySensor batterySensor; BaseSensor *sensors[] = { &dustSensor, &tempHumiditySensor, &distanceSensor, &accelerationSensor, - // &batterySensor + &batterySensor }; SBDisplay display; @@ -47,8 +47,6 @@ void setup() SBDisplay::showLoading("Setup BLE...", 0.2); bleModule.begin(); - // batterySensor.begin(); - bleModule.createService("4fafc201-1fb5-459e-8fcc-c5c9c331914b"); SBDisplay::showLoading("Setup Sensors...", 0.4); diff --git a/sensebox-bike-atrai-v2-esp32s3/src/sensors/BatterySensor/BatterySensor.cpp b/sensebox-bike-atrai-v2-esp32s3/src/sensors/BatterySensor/BatterySensor.cpp index 522ef6a..e09bb21 100644 --- a/sensebox-bike-atrai-v2-esp32s3/src/sensors/BatterySensor/BatterySensor.cpp +++ b/sensebox-bike-atrai-v2-esp32s3/src/sensors/BatterySensor/BatterySensor.cpp @@ -1,10 +1,8 @@ #include "BatterySensor.h" -BatterySensor::BatterySensor() : BaseSensor("batterySensorTask", 2048, 10000) {} +BatterySensor::BatterySensor() : BaseSensor("batterySensorTask", 8192, 1000) {} -// 5b262dea-4565-4ea0-912f-1e453bda0ca7 -// String batteryUUID = "5B262DEA45654EA0912F1E453BDA0CA7"; -String batteryUUID = "2A19"; +String batteryUUID = "5b262dea-4565-4ea0-912f-1e453bda0ca7"; int batteryCharacteristic = 0; Adafruit_MAX17048 maxlipo; @@ -18,9 +16,8 @@ void BatterySensor::initSensor() Serial.println(F("Couldnt find Adafruit MAX17048?\nMake sure a battery is plugged in!")); delay(2000); } - // BLEModule::createService("180F"); - // batteryCharacteristic = BLEModule::createCharacteristic(batteryUUID.c_str()); + batteryCharacteristic = BLEModule::createCharacteristic(batteryUUID.c_str()); // add more if needed } @@ -43,7 +40,7 @@ bool BatterySensor::readSensorData() void BatterySensor::notifyBLE(float batteryCharge) { - // BLEModule::writeBLE(batteryCharacteristic, batteryCharge); + BLEModule::writeBLE(batteryUUID.c_str(), batteryCharge); } float BatterySensor::getBatteryCharge() diff --git a/sensebox-bike-atrai-v2-esp32s3/src/sensors/BatterySensor/BatterySensor.h b/sensebox-bike-atrai-v2-esp32s3/src/sensors/BatterySensor/BatterySensor.h index 6d95533..f57c063 100644 --- a/sensebox-bike-atrai-v2-esp32s3/src/sensors/BatterySensor/BatterySensor.h +++ b/sensebox-bike-atrai-v2-esp32s3/src/sensors/BatterySensor/BatterySensor.h @@ -4,7 +4,7 @@ #include "../BaseSensor.h" #include -// include necceary libraries +// include necessary libraries class BatterySensor : public BaseSensor { diff --git a/sensebox-bike-atrai-v2-esp32s3/src/sensors/DustSensor/DustSensor.h b/sensebox-bike-atrai-v2-esp32s3/src/sensors/DustSensor/DustSensor.h index 177f401..b98c237 100644 --- a/sensebox-bike-atrai-v2-esp32s3/src/sensors/DustSensor/DustSensor.h +++ b/sensebox-bike-atrai-v2-esp32s3/src/sensors/DustSensor/DustSensor.h @@ -5,7 +5,7 @@ #include // #include -// include necceary libraries +// include necessary libraries class DustSensor : public BaseSensor { diff --git a/sensebox-bike-atrai-v2-esp32s3/src/sensors/SampleSensor/SampleSensor.h b/sensebox-bike-atrai-v2-esp32s3/src/sensors/SampleSensor/SampleSensor.h index c46b53b..cc756e4 100644 --- a/sensebox-bike-atrai-v2-esp32s3/src/sensors/SampleSensor/SampleSensor.h +++ b/sensebox-bike-atrai-v2-esp32s3/src/sensors/SampleSensor/SampleSensor.h @@ -3,7 +3,7 @@ #include "../BaseSensor.h" -// include necceary libraries +// include necessary libraries class SampleSensor : public BaseSensor {