-
Notifications
You must be signed in to change notification settings - Fork 24
/
G35StringGroup.h
43 lines (32 loc) · 1.22 KB
/
G35StringGroup.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
/*
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.
Original version by Paul Martis (http://www.digitalmisery.com). See
README for complete attributions.
*/
#ifndef INCLUDE_G35_STRING_GROUP_H
#define INCLUDE_G35_STRING_GROUP_H
#include <G35.h>
// A G35StringGroup takes a set of G35 instances and presents them as a single
// virtual light string of arbitrary length.
//
// A LightProgram that is given a G35StringGroup will then be able to run
// itself over the whole virtual string, without needing to know the details
// of which physical string contains which logical bulb.
class G35StringGroup : public G35 {
public:
G35StringGroup();
void AddString(G35* g35);
virtual uint16_t get_light_count();
virtual void set_color(uint8_t bulb, uint8_t intensity, color_t color);
virtual void broadcast_intensity(uint8_t intensity);
protected:
virtual uint8_t get_broadcast_bulb();
private:
enum { MAX_STRINGS = 16 };
uint8_t string_count_;
G35* strings_[MAX_STRINGS];
uint16_t string_offsets_[MAX_STRINGS];
};
#endif // INCLUDE_G35_STRING_GROUP_H