BatteryInterface.h 469 B

123456789101112131415161718192021222324252627282930
  1. #ifndef BatteryInterface_h
  2. #define BatteryInterface_h
  3. #include <Arduino.h>
  4. #include "configs.h"
  5. #include <Wire.h>
  6. #define I2C_SDA 33
  7. #define I2C_SCL 22
  8. #define IP5306_ADDR 0x75
  9. class BatteryInterface {
  10. private:
  11. uint32_t initTime = 0;
  12. public:
  13. int8_t battery_level = 0;
  14. int8_t old_level = 0;
  15. bool i2c_supported = false;
  16. BatteryInterface();
  17. void RunSetup();
  18. void main(uint32_t currentTime);
  19. int8_t getBatteryLevel();
  20. };
  21. #endif