Skip to content

Commit d7cded5

Browse files
committed
Added class documentation per spydergt1's request in issue 6.
1 parent c8294a0 commit d7cded5

File tree

5 files changed

+31
-2
lines changed

5 files changed

+31
-2
lines changed

G35.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
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.
3737
class G35 {
3838
public:
3939
G35();

G35String.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@
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().
1525
class G35String : public G35 {
1626
public:
1727
// |pin|: the Arduino pin driving this string's data line.

G35StringGroup.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
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.
1521
class G35StringGroup : public G35 {
1622
public:
1723
G35StringGroup();

LightProgram.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
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."
1720
class LightProgram {
1821
public:
1922
LightProgram(G35& g35)

ProgramRunner.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@
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.
1626
class ProgramRunner {
1727
public:
1828
ProgramRunner(LightProgram* (*program_creator)(uint8_t program_index),

0 commit comments

Comments
 (0)