File tree 2 files changed +12
-9
lines changed
2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -38,15 +38,21 @@ void setup() {
38
38
while (!Serial);
39
39
delay (1000 ); // Delay to give time to load the Serial Monitor
40
40
41
-
42
- // Charger charger = Charger();
43
- // charger.begin();
41
+ charger = Charger ();
42
+ charger.begin ();
43
+ auto chargeVoltage = charger.getChargeVoltage ();
44
+ auto endOfChargeCurrent = charger.getEndOfChargeCurrent ();
45
+ // charger.setChargeVoltage(4.2); // Set the charge voltage in V
44
46
// charger.setEndOfChargeCurrent(5); // Set the end of charge current in mA
45
- Serial.println (" Charger initialized." );
47
+ Serial.println (" * 🔌 Charger initialized." );
48
+ Serial.println (" * ⚡️ Charge voltage: " + String (chargeVoltage) + " V" );
49
+ Serial.println (" * ⚡️ End of charge current: " + String (endOfChargeCurrent) + " mA" );
46
50
47
51
BatteryCharacteristics characteristics = BatteryCharacteristics ();
48
52
characteristics.capacity = 200 ; // Battery capacity in mAh. Change this value to match your battery's capacity.
49
- characteristics.endOfChargeCurrent = 5 ; // End of charge current in mA
53
+ characteristics.ntcResistor = NTCResistor::Resistor10K; // NTC resistor value 10 or 100 kOhm
54
+ characteristics.endOfChargeCurrent = endOfChargeCurrent; // End of charge current in mA
55
+ characteristics.chargeVoltage = chargeVoltage; // Charge voltage in V
50
56
51
57
battery = Battery (characteristics);
52
58
bool batteryInitialized = battery.begin (true );
Original file line number Diff line number Diff line change @@ -57,10 +57,7 @@ Board::Board() {
57
57
}
58
58
59
59
bool Board::begin () {
60
- if (PMIC.begin () != 0 ){
61
- return false ;
62
- }
63
- return true ;
60
+ return PMIC.begin () == 0 ;
64
61
}
65
62
66
63
bool Board::isUSBPowered () {
You can’t perform that action at this time.
0 commit comments