Light Show library for organic, calm, light display.
Dependencies: BLE_API mbed nRF51822
Fork of mbed_blinky by
Diff: light_show.h
- Revision:
- 25:d48f46d753fd
- Parent:
- 24:52319c0a14b8
- Child:
- 26:8bc9984c4600
--- a/light_show.h Sat Jan 30 20:07:55 2016 +0000 +++ b/light_show.h Mon Feb 01 01:02:46 2016 +0000 @@ -1,29 +1,42 @@ #ifndef LIGHT_SHOW_H #define LIGHT_SHOW_H +#include "macros.h" +#include "config.h" +#include "utility.h" + +#include "rgb_led.h" +#include "sinusoid.h" + +extern Serial pc; + +const float HYSTERESIS_QUANTITY = HPI; +const float INCREMENT = 0.05f; + class LightShow { public: + LightShow(Rgb*); void randomize_params(); - void drive(); + + void show(); + void simple_show(); /** sanity check **/ + +private: + Rgb* strip; + Sinusoid sine_waves[3]; -private: + // get some randomness + Timer t; + static const float HYSTERESIS_QUANTITY = PI/4; - // Arbitrary params for the show - static const float RWAIT = 0; - static const float GWAIT = PI/8; - static const float BWAIT = PI/4; - float WAIT [3]; - float SCALE [3]; + float time; // phase + uint8_t finished; // bit mask for smooth fade out + float hysteresis; + float rgb_c[3]; - // channel operators - float rgb_c[3]; - float in; // phase - uint8_t rgb; - float hysteresis; - - uint8_t i; + void update_rgb(); }; #endif \ No newline at end of file