36 SoundSensor(
unsigned int pcfBasePinNumber,
int pcfI2CAddress);
61 virtual void TurnOn()
override;
73 virtual void TurnOff()
override;
99 virtual std::string
ToString()
const override;
Abstract base class for every component (sensor, actuator, etc.) the library manages.
Definition: BaseComponent.h:60
FC-04 sound sensor - reads sound level as an analog value through a PCF8591 ADC channel.
Definition: SoundSensor.h:16
int GetPCFI2CAddress() const
Gets the PCF8591 I2C address.
Definition: SoundSensor.cpp:132
virtual void TurnOff() override
No-op: the sound sensor holds no resources that need releasing when turned off.
Definition: SoundSensor.cpp:66
virtual std::string ToString() const override
Serializes the sensor's PCF8591 base pin number and I2C address to a string.
Definition: SoundSensor.cpp:149
virtual void TurnOn() override
No-op: the sound sensor is passive and reads on demand, so there is nothing to turn on.
Definition: SoundSensor.cpp:51
SoundSensor(unsigned int pcfBasePinNumber, int pcfI2CAddress)
Builds a sound sensor bound to the given PCF8591 base pin number and I2C address.
Definition: SoundSensor.cpp:18
virtual ~SoundSensor()
Destroys the sensor, turning it off first.
Definition: SoundSensor.cpp:36
int ReadRawAnalogValue() const
Reads the raw analog sound value from the PCF8591 base pin.
Definition: SoundSensor.cpp:98
virtual void ProcessRawValues() override
No-op: the sound sensor reads its value on demand in ReadRawAnalogValue, so there are no raw values t...
Definition: SoundSensor.cpp:81
int myPCFI2CAddress
The PCF8591 I2C address.
Definition: SoundSensor.h:20
unsigned int myPCFBasePinNumber
The PCF8591 base pin number this sensor reads from.
Definition: SoundSensor.h:19
unsigned int GetPCFBasePinNumber() const
Gets the PCF8591 base pin number this sensor reads from.
Definition: SoundSensor.cpp:115
RumPi is the library's top-level facade.
Definition: AlertManager.h:6