MCPcopy Create free account
hub / github.com/FastLED/FastLED / setStrategy

Method setStrategy

src/fl/sensors/button.cpp.hpp:99–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97
98
99void ButtonLowLevel::setStrategy(ButtonStrategy strategy) {
100 mStrategy = strategy;
101 switch (mStrategy) {
102 case ButtonStrategy::kHighLowFloating:
103 mPin.setPinMode(DigitalPin::kInput);
104 break;
105 case ButtonStrategy::kPullUp:
106 mPin.setPinMode(DigitalPin::kInputPullup);
107 break;
108 case ButtonStrategy::kPullDown:
109 mPin.setPinMode(DigitalPin::kInputPulldown);
110 break;
111 default:
112 FASTLED_ASSERT(false, "Unknown ButtonLowLevel strategy");
113 break;
114 }
115}
116
117} // namespace fl

Callers

nothing calls this directly

Calls 1

setPinModeMethod · 0.45

Tested by

no test coverage detected