|
#ifndef _GECOLOREFFECTSBULB_H
#define _GECOLOREFFECTSBULB_H
class NonDisplayableBulb
{
protected:
short _colour; // the bulbs colour
byte _brightness; // the bulbs brightness
public:
#if defined(PC) || defined(RASPBERRY)
NonDisplayableBulb() {};
#endif
void Construct(short colour, byte brightness);
byte Brightness();
void SetBrightness(byte brightness);
short Colour();
void SetColour(short colourrgb);
void SetChanged();
void ClearChanged();
bool IsChanged();
static byte Red(short colour);
static byte Green(short colour);
static byte Blue(short colour);
};
// A bulb
class Bulb : public NonDisplayableBulb
{
private:
byte _string; // output pin for this bulb
byte _address; // the bulbs address
static byte GetBit(short i);
static byte GetBit2(byte i);
void PopulateOneBulbBits();
static void PopulateMultiBulbBits(Bulb* bulbs[]);
static byte GetParallelBit(short bit, byte one);
public:
#if defined(PC) || defined(RASPBERRY)
Bulb() {};
#endif
byte Address() { return _address; }
void Construct(byte string, byte address, short colour, byte brightness);
void Display();
static void DisplayParallel(Bulb* bulbs[]);
static byte RandomBrightness();
static short RandomColour();
static byte RandomBulb(byte bulbs);
byte String() { return _string; }
};
#endif // _GECOLOREFFECTSBULB_H
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.