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