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

Function setup

examples/FireCylinder/FireCylinder.h:97–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95fl::XYMap xyMap(WIDTH, HEIGHT, SERPENTINE);
96
97void setup() {
98 Serial.begin(115200); // Initialize serial communication for debugging
99
100 // Initialize the LED strip:
101 // - NEOPIXEL is the LED type
102 // - 3 is the data pin number (for real hardware)
103 // - setScreenMap connects our 2D coordinate system to the 1D LED array
104 fl::ScreenMap screen_map = xyMap.toScreenMap();
105 screen_map.setDiameter(0.1f); // Set the diameter for the cylinder (0.2 cm per LED)
106 FastLED.addLeds<NEOPIXEL, 3>(leds, HEIGHT * WIDTH).setScreenMap(screen_map);
107
108 // Apply color correction for more accurate colors on LED strips
109 FastLED.setCorrection(TypicalLEDStrip);
110}
111
112uint8_t getPaletteIndex(uint32_t millis32, int width, int max_width, int height, int max_height,
113 uint32_t y_speed) {

Callers

nothing calls this directly

Calls 5

setDiameterMethod · 0.80
beginMethod · 0.45
toScreenMapMethod · 0.45
setScreenMapMethod · 0.45
setCorrectionMethod · 0.45

Tested by

no test coverage detected