FastLED 3.9.15
Loading...
Searching...
No Matches
digital_pin.h
Go to the documentation of this file.
1#pragma once
2
3#include <stdint.h>
4
5#include "fl/ptr.h"
6
7
8namespace fl {
9
11
12
13// A simple digital pin. If we are compiling in an Arduino environment, then
14// this class will bind to that. Otherwise it will fall back to the platform api.
15// Note that this class does not support analog mode nor pullups/pulldowns.
17 public:
18 enum Mode {
19 kInput = 0,
22 // kInputPulldown, Not implemented in Arduino.h
23 };
24
25 DigitalPin(int pin);
27 DigitalPin(const DigitalPin &other);
29
30 DigitalPin(DigitalPin &&other) = delete;
31
32 void setPinMode(Mode mode);
33 bool high() const; // true if high, false if low
34 void write(bool is_high);
35 private:
36 DigitalPinImplPtr mImpl;
37};
38
39} // namespace fl
void write(bool is_high)
DigitalPin(DigitalPin &&other)=delete
void setPinMode(Mode mode)
DigitalPin & operator=(const DigitalPin &other)
DigitalPinImplPtr mImpl
Definition digital_pin.h:36
bool high() const
DigitalPin(int pin)
DigitalPin(const DigitalPin &other)
Implements a simple red square effect for 2D LED grids.
Definition crgb.h:16
#define FASTLED_SMART_PTR(type)
Definition ptr.h:31