FastLED 3.9.15
Loading...
Searching...
No Matches

◆ setup()

void setup ( )

Definition at line 159 of file old.h.

159 {
160 pinMode(PIN_GRND, OUTPUT);
161 digitalWrite(PIN_GRND, LOW); // Set ground pin to low
162 button.addRealButton(Button(PIN_BUTTON));
164 //screenMap = fl::ScreenMap::Circle(NUM_LEDS, 1.5f, 0.5f, 1.0f);
165 auto controller = addController();
166 // Set the screen map for the controller
167 controller->setScreenMap(screenMap);
168
169 // Set power management. This allows this festival stick to conformatable
170 // run on any USB battery that can output at least 1A at 5V.
171 // Keep in mind that this sketch is designed to use APA102HD mode, which will
172 // result in even lowwer run power consumption, since the power mode does not take
173 // into account the APA102HD gamma correction. However it is still a correct upper bound
174 // that will match the ledset exactly when the display tries to go full white.
175 FastLED.setMaxPowerInVoltsAndMilliamps(VOLTS, MAX_AMPS * 1000);
176 // set brightness 8
177 FastLED.setBrightness(brightness.as_int());
178 button.onChanged([](fl::UIButton& but) {
179 // This function is called when the button is pressed
180 // If the button is pressed, show the generative pattern
181 if (but.isPressed()) {
182 FL_WARN("Button pressed");
183 } else {
184 FL_WARN("NOT Button pressed");
185 }
186 });
187
188}
fl::UISlider brightness("Brightness", BRIGHTNESS, 0, 255)
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
fl::ScreenMap makeScreenMap()
Definition Fire2023.h:127
CLEDController * controller
bool isPressed() const FL_NOEXCEPT
Definition button.h:45
fl::ScreenMap screenMap
Definition Corkscrew.h:101
#define FL_WARN(X)
Definition log.h:276
void pinMode(int pin, PinMode mode)
Set pin mode (input, output, pull-up, pull-down)
Definition pin.cpp.hpp:378
void digitalWrite(int pin, PinValue val)
Write digital value to pin.
Definition pin.cpp.hpp:51
#define VOLTS
Definition old.h:22
fl::UIButton button("Button")
#define PIN_BUTTON
Definition old.h:30
corkscrew_args args
Definition old.h:149
CLEDController * addController()
Definition old.h:154
#define PIN_GRND
Definition old.h:31
#define MAX_AMPS
Definition old.h:23

References addController(), args, brightness, button(), controller, FastLED, FL_WARN, fl::UIButton::isPressed(), makeScreenMap(), MAX_AMPS, PIN_BUTTON, PIN_GRND, screenMap, and VOLTS.

+ Here is the call graph for this function: