Dagozilla to RoboCup / Mbed 2 deprecated StepperTB_Example

Dependencies:   StepperTB mbed

Files at this revision

API Documentation at this revision

Comitter:
irfantitok
Date:
Fri Nov 09 17:30:34 2018 +0000
Commit message:
Tester program buat StepperTB

Changed in this revision

StepperTB.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/StepperTB.lib	Fri Nov 09 17:30:34 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/teams/Dagozilla-to-RoboCup/code/StepperTB/#787cee5a8dad
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Nov 09 17:30:34 2018 +0000
@@ -0,0 +1,38 @@
+#include "mbed.h"
+#include "StepperTB.h"
+
+int StepPerRev = 200;
+int DelayAntarMode = 2;
+int const DelayStepperUs = 100;
+int Microstep = 32;
+
+PinName ENA_ = PH_1;
+PinName DIR_ = PB_0;
+PinName PUL_ = PC_1;
+
+//Membuat instance object Stepper
+//ENA - DIR - PUL
+StepperTB stepperqu(ENA_, DIR_, PUL_, Microstep, StepPerRev);
+
+int main(){
+        
+        while(1){
+                //Gerakkan stepper 100 step CCW dengan delay antar microstep DelayStepperUs
+                stepperqu.MoveStep(-100, DelayStepperUs);
+                //wait(DelayAntarMode);
+                
+                //Gerakkan stepper 100 step CW dengan delay antar microstep DelayStepperUs
+                stepperqu.MoveStep(100, DelayStepperUs);
+                wait(DelayAntarMode);
+                
+                /*
+                //Gerakkan stepper 1 putaran CCW dengan delay antar microstep DelayStepperUs
+                stepperqu.MoveRev(1, DelayStepperUs);
+                wait(DelayAntarMode);
+                
+                //Gerakkan stepper 1 putaran CW dengan delay antar microstep DelayStepperUs
+                stepperqu.MoveRev(-1, DelayStepperUs);
+                wait(DelayAntarMode);
+                */
+            }
+    }
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Nov 09 17:30:34 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/e95d10626187
\ No newline at end of file