Bela
Real-time, ultra-low-latency audio and sensor processing system for BeagleBone Black
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
SteppedPot.h
1 #pragma once
2 #include <vector>
11 {
12 public:
13  SteppedPot() {};
17  SteppedPot(const std::vector<float>& levelsV, float toleranceV, float fullScale = 1);
27  void setup(const std::vector<float>& levelsV, float toleranceV, float fullScale = 1);
33  bool process(float value);
39  unsigned int get();
40 private:
41  unsigned int position;
42  bool isInState(float value, unsigned int p);
43  std::vector<float> levels;
44  float tolerance;
45  bool inited;
46 };
Connect a stepped potentiometer.
Definition: SteppedPot.h:10
void setup(const std::vector< float > &levelsV, float toleranceV, float fullScale=1)
Definition: SteppedPot.cpp:9
bool process(float value)
Definition: SteppedPot.cpp:19