AwesomeStudioPedal
A programmable, multi-profile foot controller for DAWs, score readers, and studio automation
Loading...
Searching...
No Matches
non_send_action.cpp
Go to the documentation of this file.
1#include "non_send_action.h"
2#ifndef HOST_TEST_BUILD
3#include <Arduino.h>
4#endif
5
6LEDBlinkAction::LEDBlinkAction(ILEDController& led, uint32_t blinkCount, uint32_t blinkDuration)
7 : led(led), blinkCount(blinkCount), blinkDuration(blinkDuration)
8{
9}
10
12{
13 for (uint32_t i = 0; i < blinkCount; i++)
14 {
15 led.setState(true); // Turn LED on
16#ifndef HOST_TEST_BUILD
17 delay(blinkDuration);
18#else
19 // In host tests, we can't use delay, so just skip it
20 (void) blinkDuration; // Silence unused variable warning
21#endif
22 led.setState(false); // Turn LED off
23 if (i < blinkCount - 1) // Don't delay after last blink
24 {
25#ifndef HOST_TEST_BUILD
26 delay(blinkDuration);
27#else
28 (void) blinkDuration; // Silence unused variable warning
29#endif
30 }
31 }
32}
Interface for LED control functionality.
virtual void setState(bool state)=0
void execute() override
Executes the LED blink action.
LEDBlinkAction(ILEDController &led, uint32_t blinkCount=3, uint32_t blinkDuration=200)
Constructs an LEDBlinkAction.