1#ifndef SENSESP_SENSORS_ANALOG_READER_H_
2#define SENSESP_SENSORS_ANALOG_READER_H_
55 if (!(max_voltage > 0.) || !std::isfinite(max_voltage)) {
57 ESP_LOGE(__FILENAME__,
58 "Invalid max_voltage %f mV; using the default %f mV instead",
Used by AnalogInput as a hardware abstraction layer.
virtual ~BaseAnalogReader()=default
virtual float read()=0
Read the input as a fraction of the full-scale reference voltage.
Calibrated analog reader for the ESP32 family.
static constexpr float kDefaultMaxVoltage
The nominal 3.3 V supply voltage, in millivolts.
ESP32AnalogReader(int pin, float max_voltage=kDefaultMaxVoltage)
float read() override
Read the input as a fraction of the full-scale reference voltage.
ESP32AnalogReader AnalogReader