Files
hexapod-robot/2026-current/robot/Battery.h
T

13 lines
317 B
C++
Raw Normal View History

#pragma once
#include <Arduino.h>
// Battery voltage through a resistor divider (Config.h BATTERY_*), smoothed.
class Battery {
public:
void update(float dt);
uint16_t millivolts() const { return (uint16_t)(volts_ * 1000.0f + 0.5f); } // 0 = not fitted
private:
float volts_ = 0;
bool primed_ = false;
};