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.
Dependencies: Motor PID Joystick_OrdoV5 mbed
Fork of Joystick_OrdoV6_3 by
Revision 21:da2f3d04468f, committed 2017-01-28
- Comitter:
- MarchioKevin
- Date:
- Sat Jan 28 07:24:07 2017 +0000
- Parent:
- 20:54dc93e7b016
- Commit message:
- Optimasi, Kontrol semi-otomatis fixed
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sat Jan 28 04:33:39 2017 +0000
+++ b/main.cpp Sat Jan 28 07:24:07 2017 +0000
@@ -64,10 +64,10 @@
float kpX=0.5, kpY=0.5, kp_tetha=0.03;
/* Deklarasi encoder */
-encoderKRAI encoderDepan( PB_13, PB_14, 2000, encoderKRAI::X2_ENCODING); //inA, inB, pin Indeks (NC = tak ada), resolusi, pembacaan
-encoderKRAI encoderBelakang( PC_11, PC_10, 2000, encoderKRAI::X2_ENCODING); //inA, inB, pin Indeks (NC = tak ada), resolusi, pembacaan
-encoderKRAI encoderKanan( PC_12, PD_2, 720, encoderKRAI::X2_ENCODING); //inA, inB, pin Indeks (NC = tak ada), resolusi, pembacaan
-encoderKRAI encoderKiri( PC_4, PB_15, 2000, encoderKRAI::X2_ENCODING); //inA, inB, pin Indeks (NC = tak ada), resolusi, pembacaan
+encoderKRAI encoderDepan( PB_13, PB_14, 2000, encoderKRAI::X2_ENCODING); //inA, inB, pin Indeks (NC = tak ada), resolusi, pembacaan
+encoderKRAI encoderBelakang( PC_11, PC_10, 2000, encoderKRAI::X2_ENCODING); //inA, inB, pin Indeks (NC = tak ada), resolusi, pembacaan
+encoderKRAI encoderKanan( PC_12, PD_2, 720, encoderKRAI::X2_ENCODING); //inA, inB, pin Indeks (NC = tak ada), resolusi, pembacaan
+encoderKRAI encoderKiri( PC_4, PB_15, 2000, encoderKRAI::X2_ENCODING); //inA, inB, pin Indeks (NC = tak ada), resolusi, pembacaan
/* Deklarasi Motor Base */
Motor motor1(PB_7, PA_14, PA_15); // pwm, fwd, rev
@@ -338,12 +338,14 @@
}
case (9) :{
// Kanan
- if (case_ger != caseSebelum) XT = XT + PERPINDAHAN;
+ if (case_ger != caseSebelum)
+ XT = XT + PERPINDAHAN;
break;
}
case (10) :{
// Kiri
- if (case_ger != caseSebelum) XT = XT - PERPINDAHAN;
+ if (case_ger != caseSebelum)
+ XT = XT - PERPINDAHAN;
break;
}
default :{}
@@ -498,7 +500,8 @@
}
else {
joystick.idle();
- }
+ }
+ if (!manual)
gotoXYT(XT,YT,Tetha);
}
}
