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

◆ setup()

void setup ( )

Definition at line 160 of file old.h.

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

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

+ Here is the call graph for this function: