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

◆ setup()

void setup ( )

Definition at line 152 of file old.h.

152 {
153 pinMode(PIN_GRND, OUTPUT);
154 digitalWrite(PIN_GRND, LOW); // Set ground pin to low
155 button.addRealButton(Button(PIN_BUTTON));
157 //screenMap = ScreenMap::Circle(NUM_LEDS, 1.5f, 0.5f, 1.0f);
158 auto controller = addController();
159 // Set the screen map for the controller
160 controller->setScreenMap(screenMap);
161
162 // Set power management. This allows this festival stick to conformatable
163 // run on any USB battery that can output at least 1A at 5V.
164 // Keep in mind that this sketch is designed to use APA102HD mode, which will
165 // result in even lowwer run power consumption, since the power mode does not take
166 // into account the APA102HD gamma correction. However it is still a correct upper bound
167 // that will match the ledset exactly when the display tries to go full white.
168 FastLED.setMaxPowerInVoltsAndMilliamps(VOLTS, MAX_AMPS * 1000);
169 button.onChanged([](UIButton& but) {
170 // This function is called when the button is pressed
171 // If the button is pressed, show the generative pattern
172 if (but.isPressed()) {
173 FASTLED_WARN("Button pressed");
174 } else {
175 FASTLED_WARN("NOT Button pressed");
176 }
177 });
178
179}
CFastLED FastLED
Global LED strip management instance.
ScreenMap makeScreenMap()
Definition Fire2023.ino:118
CLEDController * controller
bool isPressed() const
Definition ui.h:111
fl::ScreenMap screenMap
Definition curr.h:119
#define VOLTS
Definition curr.h:24
#define PIN_BUTTON
Definition curr.h:31
#define PIN_GRND
Definition curr.h:32
#define MAX_AMPS
Definition curr.h:25
corkscrew_args args
Definition old.h:142
CLEDController * addController()
Definition old.h:147
#define FASTLED_WARN
Definition warn.h:7
UIButton button("Trigger")

References addController(), args, 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: