Light Show library for organic, calm, light display.
Dependencies: BLE_API mbed nRF51822
Fork of mbed_blinky by
sinusoid.h@24:52319c0a14b8, 2016-01-30 (annotated)
- Committer:
- nargetdev
- Date:
- Sat Jan 30 20:07:55 2016 +0000
- Revision:
- 24:52319c0a14b8
- Child:
- 25:d48f46d753fd
main test harness
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nargetdev | 24:52319c0a14b8 | 1 | #ifndef SINUSOID_H |
nargetdev | 24:52319c0a14b8 | 2 | #define SINUSOID_H |
nargetdev | 24:52319c0a14b8 | 3 | |
nargetdev | 24:52319c0a14b8 | 4 | class Sinusoid { |
nargetdev | 24:52319c0a14b8 | 5 | public: |
nargetdev | 24:52319c0a14b8 | 6 | |
nargetdev | 24:52319c0a14b8 | 7 | /** Get value of Sinusoid |
nargetdev | 24:52319c0a14b8 | 8 | * Returns a float between 0 and 1 |
nargetdev | 24:52319c0a14b8 | 9 | * - This value is zero if time is < wait |
nargetdev | 24:52319c0a14b8 | 10 | **/ |
nargetdev | 24:52319c0a14b8 | 11 | float get_y(); |
nargetdev | 24:52319c0a14b8 | 12 | |
nargetdev | 24:52319c0a14b8 | 13 | private: |
nargetdev | 24:52319c0a14b8 | 14 | Sinusoid(float wait, float frequency); |
nargetdev | 24:52319c0a14b8 | 15 | |
nargetdev | 24:52319c0a14b8 | 16 | long int time; |
nargetdev | 24:52319c0a14b8 | 17 | // PI macros |
nargetdev | 24:52319c0a14b8 | 18 | static const float INCREMENT = 0.00628*4; |
nargetdev | 24:52319c0a14b8 | 19 | static const float HPI = 1.571; |
nargetdev | 24:52319c0a14b8 | 20 | static const float PI = 3.1416; |
nargetdev | 24:52319c0a14b8 | 21 | |
nargetdev | 24:52319c0a14b8 | 22 | float wait; // before this y is zero |
nargetdev | 24:52319c0a14b8 | 23 | float frequency; |
nargetdev | 24:52319c0a14b8 | 24 | |
nargetdev | 24:52319c0a14b8 | 25 | |
nargetdev | 24:52319c0a14b8 | 26 | }; |
nargetdev | 24:52319c0a14b8 | 27 | |
nargetdev | 24:52319c0a14b8 | 28 | #endif |