JIAWEI ZHANG / Mbed 2 deprecated ele350ku

Dependencies:   mbed

Dependents:   Exercise8_1-2-3

Fork of ele350 by JIAWEI ZHANG

Revision:
58:0682cb4f5f3a
Parent:
57:53e6a0e9825c
--- a/sine_app.cpp	Fri Dec 18 16:34:27 2015 +0000
+++ b/sine_app.cpp	Fri Dec 18 16:35:54 2015 +0000
@@ -25,7 +25,7 @@
    
    if ( this->frequence > 50.0f ) {                                                   //Define the max frequence value and check it.//
    this->analogOut->write(0);                                                         //If >max value, output 0.//
-    } else { this->analogOut->write(this->amplitude/3.0f);} //If <max value, out the right expression.//
+    } else { this->analogOut->write(this->amplitude/3.0f*0.5f*(1.0f+sin(this->frequence*6.28f*timer.read())));} //If <max value, out the right expression.//
    
 
 }