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
LightSnoop.h
- Committer:
- isonno
- Date:
- 2012-01-16
- Revision:
- 2:965388eecf95
- Parent:
- 0:6da5625a6946
File content as of revision 2:965388eecf95:
// // LightSnoop.h - Listen to a serial stream, and determine light // colors and settings from it. // #ifndef __LIGHTSNOOP__ #define __LIGHTSNOOP__ #ifndef MBED_H #include "mbed.h" #endif #include <vector> class LightString; typedef enum { kAwaitCommand, kAwaitID, kAwaitValue } ESnoopState; const int kBufferMax = 600; class LightSnoop { public: LightSnoop( int numLights ); ~LightSnoop() {} void SaveSnoop(); void Listen( const uint8_t ch ); bool IsActive(); private: void Process( const uint8_t ch ); vector<uint16_t> fLightValues; ESnoopState fSnoopState; uint8_t fCommand; uint8_t fID; uint8_t fBuffer[kBufferMax]; int fBufferIndex, fLastBufferIndex; }; #endif