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

Method setPinMode

src/fl/sensors/digital_pin.cpp.hpp:20–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18 ~DigitalPinImpl() FL_NOEXCEPT = default;
19
20 void setPinMode(DigitalPin::Mode mode) {
21 fl::PinMode pinMode;
22 switch (mode) {
23 case DigitalPin::kInput:
24 pinMode = fl::PinMode::Input;
25 break;
26 case DigitalPin::kOutput:
27 pinMode = fl::PinMode::Output;
28 break;
29 case DigitalPin::kInputPullup:
30 pinMode = fl::PinMode::InputPullup;
31 break;
32 case DigitalPin::kInputPulldown:
33 pinMode = fl::PinMode::InputPulldown;
34 break;
35 default:
36 return;
37 }
38 fl::pinMode(mPin, pinMode);
39 }
40
41 bool high() {
42 return fl::digitalRead(mPin) == fl::PinValue::High;

Callers

nothing calls this directly

Calls 1

pinModeFunction · 0.50

Tested by

no test coverage detected