BatteryInterface.h 447 B

12345678910111213141516171819202122232425262728
  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. int8_t old_level = 0;
  14. bool i2c_supported = false;
  15. BatteryInterface();
  16. void RunSetup();
  17. void main(uint32_t currentTime);
  18. int8_t getBatteryLevel();
  19. };
  20. #endif