-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
executable file
·30 lines (24 loc) · 945 Bytes
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "hw.h"
#include "laborlicht.h"
int main(int argc, char *argv[]) {
init_hw();
// to avoid compiler warnings regarding unused functions, here is a quick
// demonstration of the set_color_preset() function
set_color_preset(color_black); // on startup, it's black anyway
// quick color test at startup (15 seconds)
for (color_preset_t preset = color_red; preset < color_MAX; ++preset) {
color_fade_preset(preset, 128, 16);
}
while(1) {
// fade through all color presets (except for black)
for (color_preset_t preset = color_red; preset < color_MAX; ++preset) {
// fades to a color for two minutes, holds that color for one minute
color_fade_preset(preset, 255, 470);
wait(60000);
}
// fade to a random color to have a nice variety
color_fade_random(255, 470);
wait(60000);
};
}
// vim: ts=4:sts=4:sw=4:et