JIAWEI ZHANG / Mbed 2 deprecated ele350ku

Dependencies:   mbed

Dependents:   Exercise8_1-2-3

Fork of ele350 by JIAWEI ZHANG

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