47 for (AudioMixer4 *mixer :
mixers)
48 for (uint8_t ch = 0; ch < 4; ch++)
49 mixer->gain(ch, gain);
analog_t(*)(analog_t) MappingFunction
#define BEGIN_CS_NAMESPACE
void invert()
Invert the analog value.
void resetToCurrentValue()
Reset the filtered value to the value that's currently being measured at the analog input.
void map(MappingFunction fn)
Specify a mapping function/functor that is applied to the analog value after filtering and before app...
float getFloatValue() const
Get the filtered value of the analog input with the mapping function applied as a floating point numb...
bool update()
Read the analog input value, apply the mapping function, and update the average.
A class for serial-in/parallel-out shift registers, like the 74HC595 that are connected to the SPI bu...
A super class for object that have to be updated regularly.
A class for controlling the volume of AudioMixer4 objects using a potentiometer.
VolumeControl(const Array< AudioMixer4 *, N > &mixers, pin_t analogPin, float maxGain=1.0)
Create a new VolumeControl object.
Array< AudioMixer4 *, N > mixers
void update() override
Read the potentiometer value, and adjust the gain of the mixers.
void map(MappingFunction fn)
Specify a mapping function that is applied to the raw analog value before setting the volume.
void begin() override
Initialize.
void invert()
Invert the analog value.
AH::FilteredAnalog filteredAnalog
An array wrapper for easy copying, comparing, and iterating.
Type for storing pin numbers of Extended Input/Output elements.