yajuan yue / Mbed 2 deprecated ele350

Dependencies:   mbed

Fork of ele350 by JIAWEI ZHANG

Files at this revision

API Documentation at this revision

Comitter:
GGHHHH
Date:
Thu Nov 05 12:55:48 2015 +0000
Parent:
4:badd73a8d806
Child:
6:f804bb3faa26
Commit message:
1

Changed in this revision

soft_pwm.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/soft_pwm.cpp	Thu Nov 05 12:24:05 2015 +0000
+++ b/soft_pwm.cpp	Thu Nov 05 12:55:48 2015 +0000
@@ -26,13 +26,13 @@
      this->period = initialPeriod;
      this->dutyCycle = initialDutyCycle;
      
-     pwm.setDutyCycle((1.0f+sin(breathingTimer.read()*M_PI))/2.0f);
+     
      this->timer.start();
-
+}
 bool SoftPwm::isOn()
-
+{
     float onPhaseDuration = this->dutyCycle * this->period;
-    float currentTime = this->timer.reset();
+    float currentTime = this->timer.read();
     
     if (currentTime < onPhaseDuration){
         return true;