#include <Voltage.h>
Public Member Functions | |
MyVoltage (MyOptions &options, MyData &data) | |
bool | begin () |
void | readVoltage () |
Protected Attributes | |
MyOptions & | myOptions |
Reference to global options. | |
MyData & | myData |
Reference to global data. | |
long | lowPowerStartSec |
Switch off timestamp. | |
Voltage Reader. Works with the voltage divider resistors and the analog input reader.
bool MyVoltage::begin | ( | ) |
Reads the voltage at startup.
Definition at line 55 of file Voltage.h.
References ANALOG_FACTOR, MyData::isLowPower, lowPowerStartSec, myData, MyDbg(), myOptions, MyOptions::powerSaveModeVoltage, and MyData::voltage.
Referenced by setup().
void MyVoltage::readVoltage | ( | ) |
Reads the power supply voltage and save the value in the data class. Add the lowPower time to the lowPowerActive and lowPowerPowerOn time.
Definition at line 67 of file Voltage.h.
References ANALOG_FACTOR, MyData::isLowPower, MyData::isPowerOn, MyData::RtcData::lowPowerActiveTimeSec, MyData::RtcData::lowPowerPowerOnTimeSec, lowPowerStartSec, myData, MyDbg(), myOptions, MyOptions::powerSaveModeVoltage, MyData::rtcData, and MyData::voltage.
Referenced by loop().