BatteryInterface.h 421 B

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