デバッグ中PWM1ch20161212

Dependencies:   mbed

Revision:
1:505435f49bf9
Parent:
0:7e84644181bb
--- a/main.cpp	Mon Dec 12 07:50:36 2016 +0000
+++ b/main.cpp	Mon Dec 12 07:55:56 2016 +0000
@@ -44,7 +44,11 @@
  //RESP section
         n_sample = (period - tstart) / sample_dt;
         tend = fmod((period - tstart) , sample_dt);
-
+        if(tend == 0){
+            n_sample = n_sample-1;
+            }
+        else {
+            }
         t_samplepoint = tstart + sample_dt * n; //time of sampling point
         n_samplepoint = t_samplepoint / table_dt;
         rem_samplepoint = fmod(t_samplepoint , table_dt);