Source code for the Curilights Controller. See http://www.saccade.com/writing/projects/CuriController/ for details.
Dependencies: FatFileSystem mbed
This is the source code for the Curilights controller. This lets you interactively control a string of Curilights. It provides a simple click-wheel user interface for changing colors, brightness and behavior. It responds to movement and lighting.
Finished Controller
System Block Diagram
SystemState.h
- Committer:
- isonno
- Date:
- 2013-02-11
- Revision:
- 4:cfef06d8bb96
- Parent:
- 3:0ac64c4ca40f
File content as of revision 4:cfef06d8bb96:
#ifndef _SYSTEMSTATE_ #define _SYSTEMSTATE_ #ifndef _USERINTERFACE_ #include "UserInterface.h" #endif #ifndef MBED_H #include "mbed.h" #endif #include <string> #define DEFINE_GET_SET_VAR( vtype, name ) \ public:\ vtype Get ## name() const { return f ## name; };\ void Set ## name( const vtype& var ) { if (f ## name != var) { f ## name = var; Modified(); } };\ private:\ vtype f ## name; class SystemState { public: SystemState(); ~SystemState() {}; bool LoadState(); void DumpState(); // Debug DEFINE_GET_SET_VAR( ESelector, ModeSelector ) DEFINE_GET_SET_VAR( int, BrightLevel ) DEFINE_GET_SET_VAR( int, SatColorIndex) DEFINE_GET_SET_VAR( int, PatternIndex ) DEFINE_GET_SET_VAR( int, LightSensor ) private: Timeout fStateTimer; void SaveState(); void Modified(); }; extern SystemState& gSystemState; #endif