intermediate update

This commit is contained in:
Maximilian Mewes 2024-04-30 14:54:53 +02:00
parent a9d6a15924
commit bd69c24231
6 changed files with 11 additions and 10 deletions

View File

@ -111,6 +111,7 @@
#define USERMOD_BATTERY_LOW_POWER_INDICATOR_DURATION 5
#endif
// battery types
typedef enum
{
unknown=0,

View File

@ -86,6 +86,11 @@ Specification from: [Molicel INR18650-M35A, 3500mAh 10A Lithium-ion battery, 3.
## 📝 Change Log
2024-04-30
- integrate factory pattern to make it easier to add other / custom battery types
- update readme
2023-01-04
- basic support for LiPo rechargeable batteries ( `-D USERMOD_BATTERY_USE_LIPO`)

View File

@ -13,8 +13,7 @@ class Lion : public Battery
private:
public:
Lion()
: Battery()
Lion() : Battery()
{
this->setMinVoltage(USERMOD_BATTERY_LION_MIN_VOLTAGE);
this->setMaxVoltage(USERMOD_BATTERY_LION_MAX_VOLTAGE);

View File

@ -13,8 +13,7 @@ class Lipo : public Battery
private:
public:
Lipo()
: Battery()
Lipo() : Battery()
{
this->setMinVoltage(USERMOD_BATTERY_LIPO_MIN_VOLTAGE);
this->setMaxVoltage(USERMOD_BATTERY_LIPO_MAX_VOLTAGE);

View File

@ -13,8 +13,7 @@ class Unkown : public Battery
private:
public:
Unkown()
: Battery()
Unkown() : Battery()
{
this->setMinVoltage(USERMOD_BATTERY_UNKOWN_MIN_VOLTAGE);
this->setMaxVoltage(USERMOD_BATTERY_UNKOWN_MAX_VOLTAGE);

View File

@ -9,9 +9,8 @@
/*
* Usermod by Maximilian Mewes
* Mail: mewes.maximilian@gmx.de
* GitHub: itCarl
* Date: 25.12.2022
* E-mail: mewes.maximilian@gmx.de
* Created at: 25.12.2022
* If you have any questions, please feel free to contact me.
*/
class UsermodBattery : public Usermod
@ -140,7 +139,6 @@ class UsermodBattery : public Usermod
}
#else //ESP8266 boards have only one analog input pin A0
pinMode(batteryPin, INPUT);
// voltage = readVoltage();
#endif
// plug in the right battery type