BluetoothDispatcher was added & reformatting
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
#include "board_pins.h"
|
||||
|
||||
class BatteryController {
|
||||
public:
|
||||
BatteryController(){}
|
||||
public:
|
||||
BatteryController() {}
|
||||
|
||||
void initialize() {
|
||||
pinMode(BATTERY_DATA_SWITCH_PIN, OUTPUT);
|
||||
digitalWrite(BATTERY_DATA_SWITCH_PIN, HIGH);
|
||||
}
|
||||
void initialize() {
|
||||
pinMode(BATTERY_DATA_SWITCH_PIN, OUTPUT);
|
||||
digitalWrite(BATTERY_DATA_SWITCH_PIN, HIGH);
|
||||
}
|
||||
|
||||
float measureVoltage() {
|
||||
return analogRead(BATTERY_DATA_PIN)*3.3/4095;
|
||||
}
|
||||
|
||||
int percent(int minVoltage=7200, int maxVoltage=8400) {
|
||||
return map(int(measureVoltage()*1000), minVoltage, maxVoltage, 0, 100);
|
||||
}
|
||||
};
|
||||
float measureVoltage() {
|
||||
return analogRead(BATTERY_DATA_PIN) * 3.3 / 4095;
|
||||
}
|
||||
|
||||
int percent(int minVoltage = 7200, int maxVoltage = 8400) {
|
||||
return map(int(measureVoltage() * 1000), minVoltage, maxVoltage, 0, 100);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user