mencari respon motor launcher dengan fungsi step

Dependencies:   Motor mbed millis

Files at this revision

API Documentation at this revision

Comitter:
Najib_irvani
Date:
Thu Feb 16 16:25:31 2017 +0000
Parent:
0:be14d75c8037
Commit message:
fungsi transfer motor dengan input fungsi step

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r be14d75c8037 -r 3a234ff1442b main.cpp
--- a/main.cpp	Thu Feb 16 16:24:30 2017 +0000
+++ b/main.cpp	Thu Feb 16 16:25:31 2017 +0000
@@ -3,7 +3,7 @@
 #include "Motor.h"
 #include "millis.h"
  
-encoderKRAI encoder( PB_13, PB_14, 14, encoderKRAI::X2_ENCODING);
+encoderKRAI encoder( PB_13, PB_14, 14, encoderKRAI::X4_ENCODING);
 Serial pc(USBTX,USBRX);
 Motor motor(PA_8,PC_1,PC_2);
 
@@ -23,7 +23,7 @@
         currentMillis = millis();
         
         
-        if (currentMillis-previousMillis>=100)
+        if (currentMillis-previousMillis>=10)
         {
             rpm = (double)encoder.getPulses();