FastLED 3.9.15
Loading...
Searching...
No Matches
UITest.ino
Go to the documentation of this file.
1
4
5#include <Arduino.h>
6#include <FastLED.h>
7
8// Simple test to verify UIHelp component works
9#define NUM_LEDS 16
10#define LED_PIN 2
11
13
14// Create help documentation using markdown
15UIHelp helpBasic(R"(# FastLED UIHelp Test
16
17This example demonstrates the **UIHelp** component functionality.
18
19## Features
20
21- **Markdown support** for rich text formatting
22- `Code blocks` for technical documentation
23- *Italic text* and **bold text**
24- Support for [links](https://fastled.io)
25
26## Usage
27
28```cpp
29// Basic usage
30UIHelp help("Your markdown content here");
31
32// With grouping
33UIHelp help("Content");
34help.setGroup("Documentation");
35```
36
37### Supported Markdown
391. Headers (H1, H2, H3)
402. Bold and italic text
413. Code blocks and inline code
424. Lists (ordered and unordered)
435. Links
44
45Visit [FastLED Documentation](https://github.com/FastLED/FastLED/wiki) for more examples.)");
46
47UIHelp helpAdvanced(R"(## Advanced FastLED Usage
48
49### Color Management
50
51FastLED provides several ways to work with colors:
52
53- `CRGB` for RGB colors
54- `CHSV` for HSV colors
55- `ColorFromPalette()` for palette-based colors
56
57```cpp
58// Set pixel colors
59leds[0] = CRGB::Red;
60leds[1] = CHSV(160, 255, 255); // Blue-green
61leds[2] = ColorFromPalette(RainbowColors_p, 64);
62```
63
64### Animation Patterns
65
66Common animation techniques:
67
681. **Fading**: Use `fadeToBlackBy()` or `fadeLightBy()`
692. **Color cycling**: Modify HSV hue values
703. **Movement**: Shift array contents or use math functions
71
72### Performance Tips
73
74- Call `FastLED.show()` only when needed
75- Use `FASTLED_DELAY()` instead of `delay()`
76- Consider using *fast math* functions for smoother animations)");
77
78void setup() {
79 Serial.begin(115200);
80 delay(1000);
81
82 Serial.println("UIHelp Test Example");
83 Serial.println("==================");
84
85 // Initialize LEDs
87 FastLED.setBrightness(50);
88
89 // Set up help groupings
90 helpBasic.setGroup("Getting Started");
91 //helpAdvanced.setGroup("Advanced Topics");
92
93 Serial.println("UIHelp components created successfully!");
94 Serial.println("Check the web interface for rendered help documentation.");
95}
96
97void loop() {
98 // Simple rainbow animation for visual feedback
99 static uint8_t hue = 0;
101 FastLED.show();
102 delay(50);
103}
CRGB leds[NUM_LEDS]
#define NUM_LEDS
uint8_t hue
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
Definition FastLED.cpp:74
central include file for FastLED, defines the CFastLED class/object
UIHelp helpAdvanced(R"(## Advanced FastLED Usage ### Color Management FastLED provides several ways to work with colors: - `CRGB` for RGB colors - `CHSV` for HSV colors - `ColorFromPalette()` for palette-based colors ```cpp // Set pixel colors leds[0] = CRGB::Red; leds[1] = CHSV(160, 255, 255); // Blue-green leds[2] = ColorFromPalette(RainbowColors_p, 64); ``` ### Animation Patterns Common animation techniques: 1. **Fading**: Use `fadeToBlackBy()` or `fadeLightBy()` 2. **Color cycling**: Modify HSV hue values 3. **Movement**: Shift array contents or use math functions ### Performance Tips - Call `FastLED.show()` only when needed - Use `FASTLED_DELAY()` instead of `delay()` - Consider using *fast math* functions for smoother animations)")
void setup()
Definition UITest.ino:19
UIHelp helpBasic(R"(# FastLED UIHelp Test This example demonstrates the **UIHelp** component functionality. ## Features - **Markdown support** for rich text formatting - `Code blocks` for technical documentation - *Italic text* and **bold text** - Support for [links](https://fastled.io) ## Usage ```cpp // Basic usage UIHelp help("Your markdown content here"); // With grouping UIHelp help("Content"); help.setGroup("Documentation"); ``` ### Supported Markdown 1. Headers (H1, H2, H3) 2. Bold and italic text 3. Code blocks and inline code 4. Lists (ordered and unordered) 5. Links Visit [FastLED Documentation](https://github.com/FastLED/FastLED/wiki) for more examples.)")
void loop()
Definition UITest.ino:38
#define LED_PIN
Definition advanced.h:40
WS2812B controller class.
Definition FastLED.h:236
void fill_rainbow(struct CRGB *targetArray, int numToFill, fl::u8 initialhue, fl::u8 deltahue=5)
Fill a range of LEDs with a rainbow of colors.
Definition fill.cpp:29
@ GRB
Green, Red, Blue (0102)
Definition eorder.h:16
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:86