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:
- 26:8bc9984c4600
- Parent:
- 25:d48f46d753fd
- Child:
- 27:a55dde8334f3
File content as of revision 26:8bc9984c4600:
#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); /** constructors **/ Sinusoid():wait(0), frequency(1){} Sinusoid(float wait, float frequency); /** set sine wave frequency **/ void set_frequency(float f) {frequency = f;} /** set wave stall time **/ void set_wait_time(float w) {wait = w;} private: float wait; // before this y is zero float frequency; }; #endif