softPWM

Dependents:   2021_NHK_A

Files at this revision

API Documentation at this revision

Comitter:
THtakahiro702286
Date:
Sat Oct 16 09:00:30 2021 +0000
Parent:
1:cb8028e779a1
Commit message:
mbed os 2 ver

Changed in this revision

SoftPWM.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r cb8028e779a1 -r a0756a27dc4d SoftPWM.cpp
--- a/SoftPWM.cpp	Sat Dec 12 05:06:38 2020 +0000
+++ b/SoftPWM.cpp	Sat Oct 16 09:00:30 2021 +0000
@@ -30,8 +30,8 @@
 
 void SoftPWM::start()
 {
-//    _ticker.attach(&SoftPWM::TickerInterrapt,interval);
-    _ticker.attach(Callback<void(void)>(this,&SoftPWM::TickerInterrapt),interval);
+    _ticker.attach(callback(this, &SoftPWM::TickerInterrapt), interval);
+//    _ticker.attach(Callback<void(void)>(this,&SoftPWM::TickerInterrapt),interval);
 }
 
 void SoftPWM::stop()
@@ -41,7 +41,7 @@
         pulse = 0;
     else
         pulse = 1;
-    thread_sleep_for(width);
+    wait_ms(width);
 }
 
 void SoftPWM::period(float _period)