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

◆ setup()

void setup ( )

Definition at line 104 of file Corkscrew.h.

104 {
105 int width = corkscrew.cylinderWidth();
106 int height = corkscrew.cylinderHeight();
107
108 frameBuffer.reset(width, height);
110
112
114 &FastLED.addLeds<WS2812, 3, BGR>(leds.data(), leds.size());
115
116 // NEW: Create ScreenMap directly from Corkscrew using toScreenMap()
117 // This maps each LED index to its exact position on the cylindrical surface
118 fl::ScreenMap corkscrewScreenMap = corkscrew.toScreenMap(0.2f);
119
120 // Alternative: Create ScreenMap from rectangular XYMap (old way)
121 // fl::ScreenMap screenMap = xyMap.toScreenMap();
122 // screenMap.setDiameter(.2f);
123
124 // Set the corkscrew screen map for the controller
125 // This allows the web interface to display the actual corkscrew shape
126 controller->setScreenMap(corkscrewScreenMap);
127
128 // Initialize caching based on UI setting
129 corkscrew.setCachingEnabled(cachingEnabled.value());
130}
fl::XYMap xyMap
fl::CRGB leds[NUM_LEDS]
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
CLEDController * controller
static XYMap constructRectangularGrid(u16 width, u16 height, u16 offset=0) FL_NOEXCEPT
Definition xymap.cpp.hpp:35
fl::CLEDController CLEDController
constexpr EOrder BGR
Definition eorder.h:22
fl::Corkscrew corkscrew(CORKSCREW_TURNS, NUM_LEDS)
fl::Grid< CRGB > frameBuffer
Definition Corkscrew.h:102
fl::UICheckbox cachingEnabled("Enable Tile Caching", true)
u8 u8 height
Definition blur.h:186
u8 width
Definition blur.h:186

References BGR, cachingEnabled(), fl::XYMap::constructRectangularGrid(), controller, corkscrew(), FastLED, frameBuffer, leds, and xyMap.

+ Here is the call graph for this function: