mencari respon motor launcher dengan fungsi step

Dependencies:   Motor mbed millis

Fork of transfer_function_motor_baru by KRAI 2017

Revision:
3:6123379ef617
Parent:
2:8f1bb7191680
--- a/main.cpp	Thu Apr 13 13:52:41 2017 +0000
+++ b/main.cpp	Mon May 08 11:38:15 2017 +0000
@@ -3,11 +3,12 @@
 #include "Motor.h"
 #include "millis.h"
  
-//encoderKRAI encoder( PC_12, PD_2, 28, encoderKRAI::X4_ENCODING);
-encoderKRAI encoder( PC_10, PC_11, 28, encoderKRAI::X4_ENCODING);
+encoderKRAI encLauncherDpn( PC_10, PC_11, 28, encoderKRAI::X4_ENCODING);
+encoderKRAI encLauncherBlk( PC_12, PD_2, 28, encoderKRAI::X4_ENCODING);
 Serial pc(USBTX,USBRX);
-//Motor motor(PB_3, PC_4, PA_10);
-Motor motor(PA_5,PB_12,PA_11);
+
+Motor launcherDpn(PA_5,PA_11,PB_12); 
+Motor launcherBlk(PB_3, PC_4, PA_10);
 
 unsigned long int previousMillis = 0;
 unsigned long int currentMillis;
@@ -19,7 +20,8 @@
 
 startMillis();  
 pc.baud(115200);  
-motor.speed(0.5);
+//launcherDpn.speed(0.8);
+launcherBlk.speed(0.8);
 startMillis();
     
     while(1) {
@@ -29,9 +31,11 @@
         
         if (currentMillis-previousMillis>=12.5)
         {
-            rpm = encoder.getPulses();
+            //rpm = encLauncherDpn.getPulses();
+            rpm = encLauncherBlk.getPulses();
             pc.printf("%d\n",rpm);
-            encoder.reset();
+            //encLauncherDpn.reset();
+            encLauncherBlk.reset();
             previousMillis = currentMillis;
         }