File tree Expand file tree Collapse file tree 5 files changed +31
-2
lines changed Expand file tree Collapse file tree 5 files changed +31
-2
lines changed Original file line number Diff line number Diff line change 3232#define COLOR_INDIGO COLOR (0x6 , 0 , 0xf )
3333#define COLOR_VIOLET COLOR (0x8 , 0 , 0xf )
3434
35- // A virtual class representing a string of G35 lights of arbitrary length.
36- // LightPrograms talk to this interface.
35+ // G35 is an abstract class representing a string of G35 lights of arbitrary
36+ // length. LightPrograms talk to this interface.
3737class G35 {
3838 public:
3939 G35 ();
Original file line number Diff line number Diff line change 1212
1313#include < G35.h>
1414
15+ // A G35String knows how to talk to a real GE Color Effects light string.
16+ // In particular, it implements the set_color() method of the G35 interface.
17+ //
18+ // These strings need enumerate() to be called before anything else, so that
19+ // each bulb has an individual address. In many cases, your lights will work
20+ // as expected even if you forget to call enumerate(), because most programs
21+ // happen to do the same thing as enumerate() -- namely, they send commands
22+ // to all bulbs starting with bulb #0 and ending with bulb #N-1. If your
23+ // light programs look right but fractured, it's because you forgot to call
24+ // enumerate().
1525class G35String : public G35 {
1626 public:
1727 // |pin|: the Arduino pin driving this string's data line.
Original file line number Diff line number Diff line change 1212
1313#include < G35.h>
1414
15+ // A G35StringGroup takes a set of G35 instances and presents them as a single
16+ // virtual light string of arbitrary length.
17+ //
18+ // A LightProgram that is given a G35StringGroup will then be able to run
19+ // itself over the whole virtual string, without needing to know the details
20+ // of which physical string contains which logical bulb.
1521class G35StringGroup : public G35 {
1622 public:
1723 G35StringGroup ();
Original file line number Diff line number Diff line change 1414#include < G35.h>
1515
1616// Interface for light programs.
17+ //
18+ // A "light program" is what GE means when they say their lights include 14
19+ // programs. An example is "Chasing Red, White, and Blue."
1720class LightProgram {
1821 public:
1922 LightProgram (G35& g35)
Original file line number Diff line number Diff line change 1313
1414#include < LightProgram.h>
1515
16+ // ProgramRunner manages a collection of LightPrograms.
17+ //
18+ // It gives the current program a slice of time to run, decides when it's
19+ // time to switch to the next program, and asks the program_creator callback
20+ // to give it the next program when it's time. In Arduino terms, it's what
21+ // you want to call in your loop() method.
22+ //
23+ // switch_program() is public because the application might sometimes want
24+ // to change programs more frequently, for example if you've implemented
25+ // a remote control receiver.
1626class ProgramRunner {
1727 public:
1828 ProgramRunner (LightProgram* (*program_creator)(uint8_t program_index),
You can’t perform that action at this time.
0 commit comments