-
Notifications
You must be signed in to change notification settings - Fork 1
/
segment_models.h
90 lines (57 loc) · 1.3 KB
/
segment_models.h
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#include "Arduino.h"
#include <Adafruit_NeoPixel.h>
#ifndef SEGMENT_MODELS
#define SEGMENT_MODELS
extern Adafruit_NeoPixel led_strip; /* FIXME temporary global */
// Spot class: Everything is derived from this static spot
class Spot {
public:
// Variables
double position;
double speed;
double amplitude;
double offset;
uint8_t width;
uint32_t color;
double start_position;
uint8_t start_width;
uint32_t start_color;
// Constructor
Spot (double, uint8_t, uint32_t);
// Methods
virtual void update ();
double percent ();
};
// Circler draws itself in a loop along your strip or around the circle
class Circler : public Spot {
public:
// Constructor
Circler (double, uint8_t, uint32_t);
// Methods
void update ();
};
// Wobbler uses a sin wave to move back and forth
class Wobbler : public Spot {
public:
// Constructor
Wobbler (double, uint8_t, uint32_t);
// Methods
void update ();
};
// Pulsar uses a sin wave to fade in and out
class Pulsar : public Spot {
public:
// Constructor
Pulsar (double, uint8_t, uint32_t);
// Methods
void update ();
};
// Grower uses a sin wave to grow and shrink width
class Grower : public Spot {
public:
// Constructor
Grower (double, uint8_t, uint32_t);
// Methods
void update ();
};
#endif