FastLED 3.9.7
Loading...
Searching...
No Matches
fx1d.h
1#pragma once
2
3#include <stdint.h>
4
5#include "fl/namespace.h"
6#include "fl/xmap.h"
7#include "fx/fx.h"
8
9namespace fl {
10
11// Abstract base class for 1D effects that use a strip of LEDs.
12class Fx1d : public Fx {
13 public:
14 Fx1d(uint16_t numLeds): Fx(numLeds), mXMap(numLeds, false) {}
15 void setXmap(const XMap& xMap) {
16 mXMap = xMap;
17 }
18
19 uint16_t xyMap(uint16_t x) const {
20 return mXMap.mapToIndex(x);
21 }
22
23protected:
24 XMap mXMap;
25};
26
27} // namespace fl
28
Definition fx.h:18
Implements the FastLED namespace macros.
Implements a simple red square effect for 2D LED grids.
Definition crgb.h:16