FastLED 3.9.15
Loading...
Searching...
No Matches
client.h
Go to the documentation of this file.
1#pragma once
2
3#include "fl/stl/shared_ptr.h"
4#include "fl/stl/span.h"
5
6namespace fl {
7
29public:
35
43
48 u8 getBrightness() const { return mBrightness; }
49
57 void setOn(bool on);
58
63 bool getOn() const { return mOn; }
64
72 void clear(bool writeToStrip = false);
73
80 void update();
81
89
94 size_t getNumLEDs() const;
95
104 void setSegment(size_t start, size_t end);
105
112 void clearSegment();
113
121 void setCorrection(CRGB correction);
122
130 void setTemperature(CRGB temperature);
131
139 void setMaxRefreshRate(u16 fps);
140
145 u16 getMaxRefreshRate() const;
146
147private:
148 fl::shared_ptr<IFastLED> mController; // FastLED controller interface
149 u8 mBrightness; // Current brightness (0-255)
150 bool mOn; // On/off state
151};
152
153} // namespace fl
fl::UISlider brightness("Brightness", BRIGHTNESS, 0, 255)
CLEDController * controller
void setOn(bool on)
Set on/off state.
size_t getNumLEDs() const
Get number of LEDs.
WLEDClient(fl::shared_ptr< IFastLED > controller)
Construct WLEDClient with FastLED controller.
void clear(bool writeToStrip=false)
Clear all LEDs.
void clearSegment()
Clear the segment range (operate on full LED array)
void setSegment(size_t start, size_t end)
Set a segment range for subsequent operations.
void setTemperature(CRGB temperature)
Set color temperature.
void setCorrection(CRGB correction)
Set color correction.
void setMaxRefreshRate(u16 fps)
Set maximum refresh rate.
u16 getMaxRefreshRate() const
Get maximum refresh rate.
fl::shared_ptr< IFastLED > mController
Definition client.h:148
void setBrightness(u8 brightness)
Set brightness level.
fl::span< CRGB > getLEDs()
Get access to LED array.
void update()
Update physical LED strip.
u8 getBrightness() const
Get current brightness level.
Definition client.h:48
bool getOn() const
Get on/off state.
Definition client.h:63
unsigned char u8
Definition stdint.h:131
constexpr T * end(T(&array)[N]) FL_NOEXCEPT
Base definition for an LED controller.
Definition crgb.hpp:179
Representation of an 8-bit RGB pixel (Red, Green, Blue)
Definition crgb.h:38