Bela
Real-time, ultra-low-latency audio and sensor processing system for BeagleBone Black
|
Connect a stepped potentiometer. More...
#include <SteppedPot.h>
Public Member Functions | |
SteppedPot (const std::vector< float > &levelsV, float toleranceV, float fullScale=1) | |
void | setup (const std::vector< float > &levelsV, float toleranceV, float fullScale=1) |
bool | process (float value) |
unsigned int | get () |
Connect a stepped potentiometer.
It processes input signals to determine what step the pot is currently at. It can be used also with non-stepped potentiometers (or anything else, really, including a GUI slider) where a stepped behaviour is desired.
SteppedPot::SteppedPot | ( | const std::vector< float > & | levelsV, |
float | toleranceV, | ||
float | fullScale = 1 |
||
) |
Same as setup().
void SteppedPot::setup | ( | const std::vector< float > & | levelsV, |
float | toleranceV, | ||
float | fullScale = 1 |
||
) |
Set up the stepped potentiometer.
levelsV | a vector of values corresponding to the approximate reading of each of the pot's positions. |
toleranceV | the bipolar tolerance around each of the values in levelsV |
fullScale | a scaling factors for levelsV and toleranceV . |
bool SteppedPot::process | ( | float | value | ) |
Process a new reading from the potentiometer.
true
if the pot has changed position, false
otherwise. unsigned int SteppedPot::get | ( | ) |
Get the current position of the pot.