| 157 | } |
| 158 | |
| 159 | void setup() { |
| 160 | pinMode(PIN_GRND, OUTPUT); |
| 161 | digitalWrite(PIN_GRND, LOW); // Set ground pin to low |
| 162 | button.addRealButton(Button(PIN_BUTTON)); |
| 163 | screenMap = makeScreenMap(args); |
| 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 | } |
| 189 | |
| 190 | |
| 191 | void showGenerative(uint32_t now) { |
nothing calls this directly
no test coverage detected