ohhungooooooo

Dependencies:   QEI mbed

Fork of Jidouki by ysak okmt

Revision:
9:cccfe63e5d4c
Parent:
8:834e3af75af8
--- a/main.cpp	Mon Sep 14 09:41:37 2015 +0000
+++ b/main.cpp	Mon Sep 14 09:51:15 2015 +0000
@@ -7,11 +7,10 @@
     int c =0;                //cはスイッチによって値うける、cの値を3パターン規定し、n,mに加算減算することで使えるものにする(または単純に定義してもいいか)
     int s = c;
     int m = c;
-    mypwm011 = 1.0;
-    mypwm012 = 0.0;
+    Motor01(1.0);
     
-    mypwm021 = 1.0;
-    mypwm022 = 0.0;
+    Motor02(1.0);
+    
 /*    mypwm.period_ms(10);
     mypwm.pulsewidth_ms(1);  */
  for(int i = s; i < wheel01.getPulses();)
@@ -23,18 +22,14 @@
                 if(mypwm012<=0.1f&&mypwm022<=0.1f)
                     {mypwm012=mypwm012-0.1f;mypwm022=mypwm022-0.1f;}
                                                             }
-    mypwm030 = 1.0;
-    mypwm031 = 1.0;
+    Motor03(0.0);
     
     
 wheel01.reset();
 wheel02.reset();   //パルス値の初期化
-
-    mypwm011 = 0.0;
-    mypwm012 = 1.0;         //逆転
+    Motor01(-1.0);         //逆転
     
-    mypwm021 = 0.0;
-    mypwm022 = 1.0;         //逆転 
+    Motor02(-1.0);         //逆転 
 
 
 for(int i = m; i > wheel01.getPulses();)
@@ -49,11 +44,9 @@
             
     myled = 1;   //パルスがmの値にいくまで
     
-    mypwm011 = 1.0;
-    mypwm012 = 1.0;
+    Motor01(0.0); 
 
-    mypwm021 = 1.0;
-    mypwm022 = 1.0;
+    Motor02(0.0);