Add Battery Sensor functionality and integrate with display and app
- Implement BatterySensor class to monitor battery voltage and status. - Update App to initialize and loop BatterySensor. - Modify FaceRenderer to display battery status on the screen. - Enhance Display class with a method to draw battery icon. - Update WebUI to include battery status in the interface. - Refactor WiFiManager to improve connection handling and logging. - Adjust Settings to include factory reset functionality. - Improve HTML structure and styling in WebUI for better user experience.
This commit is contained in:
@@ -3,13 +3,14 @@
|
||||
#include "../ui/Display.h"
|
||||
#include "../settings/Settings.h"
|
||||
#include "../sensors/MoistureSensor.h"
|
||||
#include "../sensors/BatterySensor.h"
|
||||
|
||||
class FaceRenderer {
|
||||
public:
|
||||
enum Mood { HAPPY, DRY, TOO_WET };
|
||||
|
||||
void begin(Display& display, Settings& settings);
|
||||
void loop(const MoistureSensor& moisture);
|
||||
void loop(const MoistureSensor& moisture, const BatterySensor& battery);
|
||||
|
||||
bool isDeadMode() const { return _deadMode; }
|
||||
Mood mood() const { return _mood; }
|
||||
@@ -55,8 +56,8 @@ private:
|
||||
void updateDry(unsigned long now);
|
||||
void updateTooWet(unsigned long now);
|
||||
|
||||
void renderDead(unsigned long now);
|
||||
void renderNormal(unsigned long now);
|
||||
void renderDead(unsigned long now, const BatterySensor& battery);
|
||||
void renderNormal(unsigned long now, const BatterySensor& battery);
|
||||
|
||||
void drawEyesOpen(int pupilDx, int pupilDy);
|
||||
void drawEyesClosed();
|
||||
|
||||
Reference in New Issue
Block a user