FastLED 3.9.15
Loading...
Searching...
No Matches
fl::Potentiometer Class Reference

Detailed Description

Definition at line 33 of file potentiometer.h.

#include <potentiometer.h>

+ Collaboration diagram for fl::Potentiometer:

Classes

struct  Listener
 

Public Member Functions

 Potentiometer (int pin, u16 hysteresis=0)
 
void calibrateMax ()
 
void calibrateMin ()
 
u16 fractional16 () const
 
u16 getHysteresis () const
 
u16 getRangeMax () const
 
u16 getRangeMin () const
 
bool hasChanged () const
 
float normalized () const
 
int onChange (fl::function< void(float)> callback)
 
int onChange (fl::function< void(Potentiometer &)> callback)
 
u16 raw () const
 
void removeOnChange (int id)
 
void resetCalibration ()
 
void setHysteresis (u16 threshold)
 
void setHysteresisPercent (float percent)
 
void setRange (u16 min, u16 max)
 

Private Member Functions

u16 calculateDefaultHysteresis () const
 
u16 getAdcMaxValue () const
 

Private Attributes

bool mChangedThisFrame = false
 
u16 mCurrentValue = 0
 
u16 mHysteresis = 0
 
u16 mLastValue = 0
 
Listener mListener
 
u16 mMaxValue = 0
 
u16 mMinValue = 0
 
fl::function_list< void(Potentiometer &)> mOnChangeCallbacks
 
fl::function_list< void(float)> mOnChangeNormalizedCallbacks
 
PotentiometerLowLevel mPot
 

The documentation for this class was generated from the following files: