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
Revision 41:db959505e044, committed 2015-12-17
- Comitter:
- GGHHHH
- Date:
- Thu Dec 17 14:38:22 2015 +0000
- Parent:
- 40:ca1789c40924
- Child:
- 42:6eb557ade29c
- Commit message:
- k
Changed in this revision
| sine_app.cpp | Show annotated file Show diff for this revision Revisions of this file |
| square_app.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/sine_app.cpp Thu Dec 17 14:21:26 2015 +0000
+++ b/sine_app.cpp Thu Dec 17 14:38:22 2015 +0000
@@ -3,7 +3,7 @@
SineApp::SineApp(Serial* serial) : App("Sine wave", serial) {
this->analogOut = new AnalogOut (PA_4);
this->amplitude = 3.0f;
- this->frequence = 20.0f;
+ this->frequence = 50.0f;
}
void SineApp::start()
@@ -16,7 +16,7 @@
void SineApp::run()
{
- this->analogOut->write(this->amplitude/3.0*0.5*(1+sin(frequence*3.14159*2*timer.read())));
+ this->analogOut->write(this->amplitude/3.0f*0.5f*(1.0f+sin(frequence*6.28f*timer.read())));
}
--- a/square_app.cpp Thu Dec 17 14:21:26 2015 +0000
+++ b/square_app.cpp Thu Dec 17 14:38:22 2015 +0000
@@ -3,7 +3,7 @@
SquareApp::SquareApp(Serial* serial) : App("Square wave", serial) {
this->analogOut = new AnalogOut (PA_4);
this->amplitude = 3.0f;
- this->frequence = 20.0f;
+ this->frequence = 50.0f;
}
void SquareApp::start()
