JIAWEI ZHANG / Mbed 2 deprecated ele350ku

Dependencies:   mbed

Dependents:   Exercise8_1-2-3

Fork of ele350 by JIAWEI ZHANG

Revision:
47:124bc7d77d5a
Parent:
46:efa9285bf105
Child:
48:a72a8624bf2d
--- a/sine_app.cpp	Fri Dec 18 13:06:26 2015 +0000
+++ b/sine_app.cpp	Fri Dec 18 13:19:37 2015 +0000
@@ -22,9 +22,8 @@
 void SineApp::run()
 {
    this->analogOut->write(this->amplitude/3.0f*0.5f*(1.0f+sin(this->frequence*6.28f*timer.read())));
-   float frequence;
-   frequence = 50.0f;
-   if ( frequence > 50.0f ) {
+   
+   if ( this->frequence > 50.0f ) {
    this->analogOut->write(0);
     } else { this->analogOut->write(this->amplitude/3.0f*0.5f*(1.0f+sin(this->frequence*6.28f*timer.read())));}