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

◆ isPressed()

bool fl::ButtonLowLevel::isPressed ( )

Definition at line 40 of file button.cpp.hpp.

40 {
41 switch (mStrategy) {
43 return highLowFloating();
45 // Active-low: Button pulls pin to ground when pressed
46 return !mPin.high();
48 // Active-high: Button pulls pin to VCC when pressed
49 return mPin.high();
50 default:
51 FASTLED_ASSERT(false, "Unknown ButtonLowLevel strategy");
52 return false;
53 }
54}
ButtonStrategy mStrategy
Definition button.h:47
fl::DigitalPin mPin
Definition button.h:46

References highLowFloating(), fl::kHighLowFloating, fl::kPullDown, fl::kPullUp, mPin, and mStrategy.

+ Here is the call graph for this function: