Avionics
Core avionics package for CURE flight computers
Loading...
Searching...
No Matches
BatteryVoltage Class Reference

Simple ADC-based battery voltage helper. More...

#include <PowerManagement.h>

Collaboration diagram for BatteryVoltage:
Collaboration graph

Public Member Functions

 BatteryVoltage (uint8_t adcPin, float conversionFactor)
float readVoltage ()
 Sample the ADC and convert to battery voltage.
bool isAlive ()
 Check whether voltage exceeds a minimal threshold.

Detailed Description

Simple ADC-based battery voltage helper.

Note
When to use: quick health checks of the main battery using an analog pin and known divider scaling.

Definition at line 12 of file PowerManagement.h.

Constructor & Destructor Documentation

◆ BatteryVoltage()

BatteryVoltage::BatteryVoltage ( uint8_t adcPin,
float conversionFactor )
inline

Definition at line 14 of file PowerManagement.h.

Member Function Documentation

◆ isAlive()

bool BatteryVoltage::isAlive ( )
inline

Check whether voltage exceeds a minimal threshold.

Returns
true if voltage is above the survival threshold.
Note
When to use: lightweight go/no-go checks before more detailed power analysis.

Definition at line 41 of file PowerManagement.h.

◆ readVoltage()

float BatteryVoltage::readVoltage ( )
inline

Sample the ADC and convert to battery voltage.

Returns
Converted voltage reading.
Note
When to use: periodic health checks or brownout warnings.

Definition at line 22 of file PowerManagement.h.


The documentation for this class was generated from the following file: