37 PCF8591(
unsigned int pcfBasePinNumber,
int pcfI2cAddress,
float adcVoltage = 3.3f);
62 virtual void TurnOn()
override;
74 virtual void TurnOff()
override;
100 virtual std::string
ToString()
const override;
Interface for analog-to-digital converter components (e.g.
Definition: AnalogDigitalConverterComponent.h:14
PCF8591 analog-to-digital converter chip (I2C), used to read analog sensors on the Raspberry Pi.
Definition: PCF8591.h:15
PCF8591(unsigned int pcfBasePinNumber, int pcfI2cAddress, float adcVoltage=3.3f)
Builds a PCF8591 ADC bound to the given base pin, I2C address, and reference voltage.
Definition: PCF8591.cpp:21
int myPCFI2CAddress
The chip's I2C address.
Definition: PCF8591.h:19
unsigned int GetPCFBasePinNumber() const
Gets the wiringPi base pin; the chip's four ADC channels are read as base+0..base+3.
Definition: PCF8591.cpp:155
int GetPCFI2CAddress() const
Gets the chip's I2C address.
Definition: PCF8591.cpp:172
virtual int ReadAnalogValue(int adcIndex=0) override
Reads a fresh analog value from the given ADC channel, performing a dummy read and settle delay first...
Definition: PCF8591.cpp:117
virtual void TurnOff() override
No-op: the PCF8591 holds no resources that need releasing when turned off.
Definition: PCF8591.cpp:83
unsigned int myPCFBasePinNumber
The wiringPi base pin; pcf8591Setup maps the four ADC channels to base+0..base+3.
Definition: PCF8591.h:18
virtual ~PCF8591()
Destroys the ADC, turning it off first.
Definition: PCF8591.cpp:42
virtual void TurnOn() override
Initializes the PCF8591 for analog reads via wiringPi, reporting success or failure through the Alert...
Definition: PCF8591.cpp:57
virtual void ProcessRawValues() override
No-op: the PCF8591 reads its channels on demand in ReadAnalogValue, so there are no raw values to pro...
Definition: PCF8591.cpp:98
virtual std::string ToString() const override
Serializes the chip's base pin (with its channel range) and ADC voltage to a string.
Definition: PCF8591.cpp:189
RumPi is the library's top-level facade.
Definition: AlertManager.h:6