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:24:05 2015 +0000
Parent:
3:1ad50b4e51a6
Child:
5:e820e1348f98
Commit message:
ku

Changed in this revision

soft_pwm.h Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/soft_pwm.h	Thu Nov 05 12:24:05 2015 +0000
@@ -0,0 +1,25 @@
+#ifndef _SOFT_PWM_
+#define _SOFT_PWM_
+
+#include "mbed.h"
+
+class SoftPwm
+{
+    private:
+        float period;
+        float dutyCycle;
+        Timer timer;
+    public:
+    
+        SoftPwm(float initialPeriod, float initialDutycycle);
+        
+        float getPeriod();
+        float getDutyCycle();
+        
+        void setPeriod(float newPeriod);
+        void setDutyCycle(float newDutyCycle);
+        
+        bool isOn();
+        
+};
+#endif
\ No newline at end of file