Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 0:b18783e04c0e, committed 2018-11-09
- Comitter:
- irfantitok
- Date:
- Fri Nov 09 17:30:34 2018 +0000
- Commit message:
- Tester program buat StepperTB
Changed in this revision
--- /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