|
Sound Byte Libs 29c5ff3
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
Potentiometer component — smoothed ADC with deadband + change detection. More...
Go to the source code of this file.
Classes | |
| struct | sbl::components::control::PotConfig |
| class | sbl::components::control::Pot |
| Potentiometer with EWMA smoothing, deadband, and change detection. More... | |
Namespaces | |
| namespace | sbl |
| Root namespace for all Sound Byte Libs functionality. | |
| namespace | sbl::components |
| Mid-level functional components. | |
| namespace | sbl::components::control |
| Physical control components. | |
Potentiometer component — smoothed ADC with deadband + change detection.
Pot wraps CvInput (EWMA smoothing) and adds deadband suppression so that small ADC noise doesn't register as parameter changes. After EWMA filtering, the stable value only updates when the smoothed reading moves past the deadband threshold.
For multi-mode control mappings where the same knob controls different parameters depending on held buttons, call set_pickup(target) on mode switch. The output freezes at target until the physical knob crosses that value, then resumes normal tracking. This prevents parameter jumps.
Usage: sbl::components::control::Pot knob; knob.update(raw_adc_value); int32_t freq = knob.scaled(20, 20000); if (knob.changed()) { ... value moved past deadband ... }
// On mode switch: knob.set_pickup(saved_position); // freeze until knob catches up if (!knob.picked_up()) { ... show LED feedback ... }
Definition in file pot.hpp.