![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Penyesuaian pin
Dependencies: Motor PID Joystick_OrdoV5 mbed
Fork of Joystick_ManualBaseBaruV1 by
Diff: main.cpp
- Revision:
- 21:da2f3d04468f
- Parent:
- 20:54dc93e7b016
- Child:
- 22:4632f58461e0
diff -r 54dc93e7b016 -r da2f3d04468f main.cpp --- 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); } }