FastLED 3.9.15
Loading...
Searching...
No Matches

◆ setHysteresisPercent()

void Potentiometer::setHysteresisPercent ( float percent)

Definition at line 92 of file potentiometer.cpp.hpp.

92 {
93 // Clamp percent to valid range
94 if (percent < 0.0f) percent = 0.0f;
95 if (percent > 100.0f) percent = 100.0f;
96
97 // Calculate hysteresis based on calibrated range
98 u16 range = (mMaxValue > mMinValue) ? (mMaxValue - mMinValue) : getAdcMaxValue();
99 mHysteresis = static_cast<u16>((percent / 100.0f) * range);
100}

References getAdcMaxValue(), mHysteresis, mMaxValue, and mMinValue.

+ Here is the call graph for this function: