Sound Byte Libs 0.5.1-340-gab5b79a
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
encoder_step.hpp File Reference

Encoder pulse-to-step converter. More...

Detailed Description

Encoder pulse-to-step converter.

Many rotary encoders (e.g., EC11) produce multiple electrical pulses per physical detent. EncoderStep accumulates raw pulses and emits +/-1 step only when a full detent boundary is crossed.

The residual is preserved across calls, so no pulses are lost.

Usage:

sbl::control::input::EncoderStep enc(4); // EC11: 4 pulses/detent
// In the control loop:
int8_t step = enc.process(encoder.delta());
if (step != 0) { ... } // one detent click: +1 or -1

Definition in file encoder_step.hpp.

#include <cstdint>

Go to the source code of this file.

Classes

class  sbl::control::input::EncoderStep
 

Namespaces

namespace  sbl
 Root namespace for all Sound Byte Libs code.
 
namespace  sbl::control
 The control stack: scheduler, event queue, merge, CC mapping, calibration.
 
namespace  sbl::control::input
 Inputs: debounce, decoding, smoothing and scaling of raw samples.