utk magang
Dependencies: Motor Ultrasonic encoderKRAI mbed millis odometryKRAI pidKRAI
Revision 12:84cb23216f78, committed 2018-03-31
- Comitter:
- gatulz
- Date:
- Sat Mar 31 01:44:42 2018 +0000
- Parent:
- 11:d4cf81f59601
- Commit message:
- utk magang
Changed in this revision
diff -r d4cf81f59601 -r 84cb23216f78 Ultrasonic.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Ultrasonic.lib Sat Mar 31 01:44:42 2018 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/leejong87/code/Ultrasonic/#d8a93321fc01
diff -r d4cf81f59601 -r 84cb23216f78 main.cpp --- a/main.cpp Wed Oct 25 15:16:27 2017 +0000 +++ b/main.cpp Sat Mar 31 01:44:42 2018 +0000 @@ -1,7 +1,7 @@ -/** - * THROWER ROBOT - * Bismillahirahmanirrahim - * +/******************************************* + * THROWER ROBOT * + * Bismillahirahmanirrahim * + * * * To do List : * - Cari konstanta Kanan Kiri * - Cari Konstanta lagi :( @@ -12,7 +12,7 @@ * - PID maju/mundur enak enak jos * * Last Edited by : Thrower KRAI - **/ + ********************************************/ //LIBRARY @@ -22,12 +22,15 @@ #include "millis.h" #include "pidKRAI.h" #include "odometryKRAI.h" +#include "Ultrasonic.h" /*************************** * Konstanta dan Variabel * ***************************/ #define DRODA 100.0 +//ultrasonic +Ultrasonic US(PA_7, PD_2); //Variabel Robot double kll_roda = PI*DRODA; //variabel keliling robot @@ -151,7 +154,7 @@ motor_kanan.speed(pwm_kanan); motor_kiri.speed(pwm_kiri); //prev_millis2 = current_millis; - //pc.printf("%.2f %.2f %.2f %.2f %.2f\n", jarak_y, d_tetha, pulses_depan, pulses_kanan, pulses_kiri); + pc.printf("%.2f %.2f %.2f %.2f %.2f\n", jarak_y, d_tetha, pulses_depan, pulses_kanan, pulses_kiri); } if((jarak_x <= target_x[state]-(float)5.0)||(jarak_x >= target_x[state]+(float)5.0)){ /* masuk ke case sumbu X */
diff -r d4cf81f59601 -r 84cb23216f78 odometryKRAI.lib --- a/odometryKRAI.lib Wed Oct 25 15:16:27 2017 +0000 +++ b/odometryKRAI.lib Sat Mar 31 01:44:42 2018 +0000 @@ -1,1 +1,1 @@ -https://os.mbed.com/teams/KRAI-2018/code/odometryKRAI/#09f7c2750ffc +https://os.mbed.com/teams/KRAI-2018/code/odometryKRAI/#b3878b630290