yajuan yue / Mbed 2 deprecated ele350

Dependencies:   mbed

Fork of ele350 by JIAWEI ZHANG

Revision:
4:badd73a8d806
--- /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