cookbook/basic-patterns/README.md
Difficulty Level: ⭐ Beginner Time to Complete: 1-2 hours (for entire section) Prerequisites: Getting Started, Core Concepts
You'll Learn:
This section covers fundamental LED patterns that form the building blocks of more complex effects. These patterns are perfect for beginners and demonstrate core FastLED concepts.
Before working with these patterns, make sure you've completed the basic FastLED setup:
#include <FastLED.h>
#define LED_PIN 5
#define NUM_LEDS 60
#define LED_TYPE WS2812B
#define COLOR_ORDER GRB
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<LED_TYPE, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS);
FastLED.setBrightness(50); // 0-255
}
Learn how to fill your LED strip with solid colors using FastLED's efficient fill functions. These are the most basic operations you'll use in every project.
Simple animations that demonstrate timing and state management. The fade in/out effect teaches you how to create smooth transitions using brightness control.
Moving patterns that show off trail effects and position tracking. The classic Cylon/Knight Rider scanner is a great introduction to animation loops.
Colorful effects using HSV color space. Learn the difference between static and animated rainbow patterns, and why HSV makes color cycling easy.
Each pattern builds on concepts from the previous ones, so following this order is recommended for beginners.