![](/media/cache/profiles/IMG_0710-2.jpg.50x50_q85.jpg)
Light Show library for organic, calm, light display.
Dependencies: BLE_API mbed nRF51822
Fork of mbed_blinky by
sinusoid.cpp
- Committer:
- nargetdev
- Date:
- 2016-02-01
- Revision:
- 25:d48f46d753fd
- Parent:
- 24:52319c0a14b8
File content as of revision 25:d48f46d753fd:
#include "sinusoid.h" #include "mbed.h" //extern Serial pc; Sinusoid::Sinusoid(float wait, float frequency): wait(wait),frequency(2*PI*frequency) {} float Sinusoid::get_y(float time) { if ( time >= wait) { // printf("%d, %d, result: %d\r\n", rgb, (0x1 << i), (!(rgb & (0x1 << i)) ) ); return (-cos( (time - wait)*frequency ) + 1) / 2.0; } else { printf ("WAITING...\n\r"); return 0.0; } }