-
Notifications
You must be signed in to change notification settings - Fork 10
/
MEOPrograms.cpp
46 lines (41 loc) · 1.2 KB
/
MEOPrograms.cpp
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
G35: An Arduino library for GE Color Effects G-35 holiday lights.
Copyright © 2011 The G35 Authors. Use, modification, and distribution are
subject to the BSD license as described in the accompanying LICENSE file.
By Mike Tsao <http://github.com/sowbug>.
and Mark Ortiz
See README for complete attributions.
*/
#include <MEOPrograms.h>
MEOLightProgram* MEOProgramGroup::CreateProgram(MEOG35& lights,
uint8_t program_index, uint8_t pattern)
{
if (program_index == 255)
{
return new MEOSwitchOff(lights);
}
else
{
switch (program_index % ProgramCount)
{
case 0:
return new MEOWhites(lights, pattern);
case 1:
return new MEORainbow(lights, pattern);
case 2:
return new MEORandomStrobe(lights, pattern);
case 3:
return new MEOSimplexNoise(lights, pattern);
case 4:
return new MEOSineWave(lights, pattern);
case 5:
return new MEOChasing(lights, pattern);
case 6:
return new MEOColorPhasing(lights, pattern);
case 7:
return new MEODither(lights, pattern);
}
}
// not reached
return NULL;
}