JIAWEI ZHANG / Mbed 2 deprecated ele350ku

Dependencies:   mbed

Dependents:   Exercise8_1-2-3

Fork of ele350 by JIAWEI ZHANG

Files at this revision

API Documentation at this revision

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()