32 : thresh_high_(config.threshold_high),
33 thresh_low_(config.threshold_low),
34 state_(false), rising_(false), falling_(false) {}
46 if (!state_ && raw >= thresh_high_) {
48 }
else if (state_ && raw < thresh_low_) {
54 }
else if (!state_ && was) {
60 bool gate()
const {
return state_; }
92 uint16_t thresh_high_;
CV/gate input components.
uint16_t threshold_high
ADC value to trigger gate ON (~2V for 3.3V/16-bit)
uint16_t threshold_low
ADC value to trigger gate OFF (hysteresis band)