-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanimation.h
More file actions
62 lines (58 loc) · 1.24 KB
/
animation.h
File metadata and controls
62 lines (58 loc) · 1.24 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef ANIMATION_H
#define ANIMATION_H
//typedef void (*Pattern) (); //define the pattern class
class Animation
{
/*
** Class that stores all of the animations that are being used in an LED array
** Purpose: Loop only calls Animation.animate: a function that essentailly loops the
**
*/
// Class Member Variables
// FRAMERATE,
// These are initialized at startup
//int NUM_LEDS; // number of LEDS on the animation. May change this for multiple strips. Taken out for now.
//Pattern *Patternlist; // List of animation pattern functions
public:
//initialize
//inline virtual void begin(){ /*nothing*/ };
//step function must be implemented
virtual void step() = 0;
};
/*
Animation(Pattern List[], int numpatterns)
{
//NUM_LEDS = num;
Patternlist = List;
NUM_PATTERNS = numpatterns;
current_pattern=0;
}
virtual
void animate()
{
Patternlist[current_pattern]();
}
void iterate_animation() //simple for purposes of testing
{
if(current_pattern ==NUM_PATTERNS-1){
current_pattern =0;
}
else{
current_pattern++;
}
}
void set_current_animation(int pcode)
{
lastpattern = pcode;
}
int get_current_animation()
{
return(current_pattern)
}
private:
int current_pattern;
int NUM_PATTERNS;
int lastpattern;
};
*/
#endif