Light Show library for organic, calm, light display.
Dependencies: BLE_API mbed nRF51822
Fork of mbed_blinky by
sinusoid.h
- Committer:
- nargetdev
- Date:
- 2016-02-01
- Revision:
- 25:d48f46d753fd
- Parent:
- 24:52319c0a14b8
- Child:
- 26:8bc9984c4600
File content as of revision 25:d48f46d753fd:
#ifndef SINUSOID_H #define SINUSOID_H const float HPI = 1.571; const float PI = 3.1416; class Sinusoid { public: /** Get value of Sinusoid * Returns a float between 0 and 1 * - This value is zero if time is < wait **/ float get_y(float); /** default constructor **/ Sinusoid():wait(0), frequency(1){} Sinusoid(float wait, float frequency); void set_frequency(float f) {frequency = f;} void set_wait_time(float w) {wait = w;} private: // PI macros static const float INCREMENT = 0.00628*4; float wait; // before this y is zero float frequency; }; #endif