Click here to Skip to main content
15,886,840 members
Articles / Internet of Things / Arduino

Simulating and controlling GE Color Effects Lights with Arduino

Rate me:
Please Sign up or sign in to vote.
4.80/5 (13 votes)
27 Nov 2012CPOL13 min read 137.2K   1.4K   25  
Simulating and Controlling GE Color Effects Lights with Arduino
#ifndef _PROCESSOR_H

#define _PROCESSOR_H

#include "LightsString.h"

class LightsString;

class Processor
{
	byte _maxbulbs; // maximum bulbs in all strings

private:
	LightsString* _strings[MAXSTRINGS]; // collection of lights strings we are controlling
	#if defined(PC) || defined(RASPBERRY)
		bool _break;
	#endif
	bool AllDone();
	void LoadInstructions();
	void Execute();
	void ParallelDisplay();

public:
	void Construct();
	void Run();
	void SetAllColour(short colour);
	#ifdef INCLUDE_DEBUG_PATTERNS
			void SetStringBulb(byte string, byte bulb, short colour, short brightness);
	#endif
#if defined(PC) || defined(RASPBERRY)
	void Break() {_break = true;};
	Processor() { _maxbulbs = 0; };
	void AddString(const byte pin, short* program, byte stringlen, short* subroutinestable);
#else
	void AddString(const byte pin, prog_int16_t* program, prog_int8_t* stringlen, prog_int16_t* subroutinestable);
#endif
};

#endif // _PROCESSOR_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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Australia Australia
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions