1 |
|
|
#include <thread> |
2 |
|
|
|
3 |
|
|
#include "config/PatternCommand.hpp" |
4 |
|
|
|
5 |
|
|
|
6 |
|
|
namespace blink1_control::config { |
7 |
|
6 |
FadeCommand::FadeCommand(blink1_lib::PatternLineN _fadeParams) : fadeParams(_fadeParams) {} |
8 |
|
|
|
9 |
|
1 |
void FadeCommand::execute(blink1_lib::Blink1Device& device) { |
10 |
|
1 |
device.fadeToRGBN(fadeParams.fadeMillis, fadeParams.rgbn); |
11 |
|
1 |
} |
12 |
|
|
|
13 |
|
3 |
WaitCommand::WaitCommand(std::chrono::milliseconds _waitTime) : waitTime(_waitTime) {} |
14 |
|
|
|
15 |
|
1 |
void WaitCommand::execute([[maybe_unused]] blink1_lib::Blink1Device& device) { |
16 |
|
1 |
std::this_thread::sleep_for(waitTime); |
17 |
|
1 |
} |
18 |
|
|
} |