35 MCP3008(
const int basePinNum,
const int spiChannel,
const float adcVoltage = 3.3f);
60 virtual void TurnOn()
override;
72 virtual void TurnOff()
override;
98 virtual std::string
ToString()
const override;
Interface for analog-to-digital converter components (e.g.
Definition: AnalogDigitalConverterComponent.h:14
MCP3008 analog-to-digital converter chip (SPI), providing 8 channels to read analog sensors on the Ra...
Definition: MCP3008.h:15
virtual std::string ToString() const override
Serializes the chip's base pin number, SPI channel, and ADC voltage to a string.
Definition: MCP3008.cpp:136
int myBasePinNum
The wiringPi base pin number for the chip's channels.
Definition: MCP3008.h:17
MCP3008(const int basePinNum, const int spiChannel, const float adcVoltage=3.3f)
Builds an MCP3008 ADC bound to the given base pin number, SPI channel, and reference voltage.
Definition: MCP3008.cpp:20
virtual ~MCP3008()
Destroys the ADC.
Definition: MCP3008.cpp:42
virtual void TurnOff() override
No-op: the MCP3008 holds no resources that need releasing when turned off.
Definition: MCP3008.cpp:76
virtual int ReadAnalogValue(int adcIndex=0) override
Reads an analog value from the given channel over SPI (8 possible ADCs, 0 through 7).
Definition: MCP3008.cpp:110
int mySpiChannel
The SPI channel the chip is wired to.
Definition: MCP3008.h:18
virtual void TurnOn() override
Initializes the MCP3008 for analog reads via wiringPi, reporting a warning through the AlertManager o...
Definition: MCP3008.cpp:57
virtual void ProcessRawValues() override
No-op: the MCP3008 reads its channels on demand in ReadAnalogValue, so there are no raw values to pro...
Definition: MCP3008.cpp:91
RumPi is the library's top-level facade.
Definition: AlertManager.h:6