code asli
Dependencies: mbed Servo encoderKRTMI Motornew Lengan3 millis
Revision 3:6d469c371f49, committed 2019-05-19
- Comitter:
- harrymunli
- Date:
- Sun May 19 15:59:31 2019 +0000
- Parent:
- 2:ab055f0284fc
- Commit message:
- code KRTMI v3
Changed in this revision
diff -r ab055f0284fc -r 6d469c371f49 Lengan3.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Lengan3.lib Sun May 19 15:59:31 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/teams/KRTMI-2019/code/Lengan3/#42f8a5003e37
diff -r ab055f0284fc -r 6d469c371f49 Servo.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Servo.lib Sun May 19 15:59:31 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/simon/code/Servo/#36b69a7ced07
diff -r ab055f0284fc -r 6d469c371f49 main.cpp --- a/main.cpp Sun Feb 24 09:45:32 2019 +0000 +++ b/main.cpp Sun May 19 15:59:31 2019 +0000 @@ -5,9 +5,8 @@ joysticknucleo joystick(PA_0,PA_1); Serial pc(USBTX,USBRX); /* Deklarasi Motor Base */ -Motor motorDepan(PB_7, PC_3, PC_0); //(PB_9, PA_12, PC_5); -Motor motorKanan(PB_3, PA_10, PC_4); -Motor motorKiri (PB_9, PA_6, PA_12); +Motor motorKanan(PA_15, PB_0, PA_4); +Motor motorKiri (PB_7, PC_2, PC_3); int case_joy; /****************************************************/ /* Deklarasi Fungsi dan Procedure */ @@ -34,7 +33,7 @@ caseJoystick = 2; } else if ((!joystick.R1)&&(!joystick.L1)&&(joystick.atas)&&(!joystick.bawah)&&(!joystick.kanan)&&(!joystick.kiri)) { - // Pivot Kiri + // Maju caseJoystick = 3; } else if ((!joystick.R1)&&(!joystick.L1)&&(!joystick.atas)&&(!joystick.bawah)&&(!joystick.kanan)&&(joystick.kiri)) { @@ -59,54 +58,47 @@ case (1): { // Pivot Kanan - motorDepan.speed(0.23); - motorKanan.speed(0.17); - motorKiri.speed(0.23); + motorKanan.speed(0.3); + motorKiri.speed(0.4); break; } case (2): { // Pivot Kiri - motorDepan.speed(-0.23); - motorKanan.speed(-0.17); - motorKiri.speed(-0.23); + motorKanan.speed(-0.3); + motorKiri.speed(-0.4); break; } case (3): { // Maju - motorDepan.speed(0); - motorKanan.speed(-0.17); - motorKiri.speed(0.3); + motorKanan.speed(-0.5); + motorKiri.speed(0.5); break; } case (4): { // Kiri - motorDepan.speed(-0.23); - motorKanan.speed(0.17); - motorKiri.speed(0.3); + motorKanan.speed(0.5); + motorKiri.speed(0.6); break; } case (5): { //Belakang - motorDepan.speed(0); - motorKanan.speed(0.17); - motorKiri.speed(-0.3); + motorKanan.speed(0.3); + motorKiri.speed(-0.4); break; } case (6): { // Kanan - motorDepan.speed(0.23); - motorKanan.speed(-0.17); - motorKiri.speed(-0.3); + motorKanan.speed(-0.3); + motorKiri.speed(-0.4); break; } default : { - motorDepan.brake(1); motorKanan.brake(1); motorKiri.brake(1); } @@ -154,4 +146,5 @@ // previousMillis5 = millis(); // } - } \ No newline at end of file + } +} \ No newline at end of file