Skip to content

Commit 16933bd

Browse files
committed
chore: change lower cutoff voltage (battery curve)
1 parent 1353e1b commit 16933bd

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

src/battery.rs

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,17 @@ use esp_hal::analog::adc::{Adc, AdcConfig, Attenuation};
66

77
type AdcCal = esp_hal::analog::adc::AdcCalCurve<esp_hal::peripherals::ADC1<'static>>;
88

9-
const BATTERY_CURVE: [(f64, u8); 14] = [
10-
(3200.0, 0),
11-
(3250.0, 5),
12-
(3300.0, 10),
13-
(3350.0, 20),
14-
(3400.0, 30),
15-
(3450.0, 35),
16-
(3500.0, 40),
17-
(3550.0, 45),
18-
(3600.0, 50),
19-
(3700.0, 60),
20-
(3800.0, 70),
21-
(3900.0, 80),
22-
(4000.0, 90),
9+
const BATTERY_CURVE: [(f64, u8); 11] = [
10+
(3350.0, 0),
11+
(3400.0, 13),
12+
(3450.0, 19),
13+
(3500.0, 25),
14+
(3550.0, 31),
15+
(3600.0, 38),
16+
(3700.0, 50),
17+
(3800.0, 63),
18+
(3900.0, 75),
19+
(4000.0, 88),
2320
(4100.0, 100),
2421
];
2522
const BAT_MIN: f64 = BATTERY_CURVE[0].0;

0 commit comments

Comments
 (0)