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

◆ setup()

void setup ( )

Definition at line 127 of file curr.h.

127 {
128 pinMode(PIN_GRND, OUTPUT);
129 digitalWrite(PIN_GRND, LOW); // Set ground pin to low
130 button.addRealButton(Button(PIN_BUTTON));
133 // screenMap = ScreenMap::Circle(NUM_LEDS, 1.5f, 0.5f, 1.0f);
134 auto controller = addController();
135 // Set the screen map for the controller
136 controller->setScreenMap(screenMap);
137
138 // Set power management. This allows this festival stick to conformatable
139 // run on any USB battery that can output at least 1A at 5V.
140 // Keep in mind that this sketch is designed to use APA102HD mode, which
141 // will result in even lowwer run power consumption, since the power mode
142 // does not take into account the APA102HD gamma correction. However it is
143 // still a correct upper bound that will match the ledset exactly when the
144 // display tries to go full white.
145 FastLED.setMaxPowerInVoltsAndMilliamps(VOLTS, MAX_AMPS * 1000);
146 button.onChanged([](UIButton &but) {
147 // This function is called when the button is pressed
148 // If the button is pressed, show the generative pattern
149 if (but.isPressed()) {
150 FASTLED_WARN("Button pressed");
151 } else {
152 FASTLED_WARN("NOT Button pressed");
153 }
154 });
155}
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
CLEDController * addController()
Definition curr.h:121
#define PIN_GRND
Definition curr.h:32
#define MAX_AMPS
Definition curr.h:25
corkscrew_args args
Definition old.h:142
#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: