Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of ele350 by
Diff: sine_app.cpp
- Revision:
- 33:c084f49cd403
- Parent:
- 32:b28a049ebbf1
- Child:
- 34:498a218cf53e
--- a/sine_app.cpp Wed Dec 16 12:51:43 2015 +0000 +++ b/sine_app.cpp Wed Dec 16 16:09:18 2015 +0000 @@ -7,14 +7,14 @@ void SineApp::start() { App::start(); - this->analogOut->write(1.0/20); + this->analogOut->write(0.0f); this->timer.start(); } void SineApp::run() { - this->analogOut->write(1000* this->timer.read()); + this->analogOut->write(sin(2.0f*3.1415f*timer.read()); if (this->timer.read()>0.001f){ this->timer.reset();} @@ -23,7 +23,7 @@ void SineApp::stop() { App::stop(); - this->analogOut->write(0); + this->analogOut->write(0.0f); this->timer.stop(); this->timer.reset(); } \ No newline at end of file