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.
robotpin.h
00001 /*Garudago ITB 2019 Attributes*/ 00002 00003 #ifndef ROBOTPIN_H 00004 #define ROBOTPIN_H 00005 00006 #include "mbed.h" 00007 #include "encoderKRAI.h" 00008 #include "CMPS12_KRAI.h" 00009 #include "Motor.h" 00010 #include "encoderHAL.h" 00011 #include <garudago_hardware_interface/JoystickPS3.h> 00012 00013 #define PIN_OPTO_3 PB_9 //Extension shagai 1 -> Memendek 00014 #define PIN_OPTO_4 PB_6 //Penaik gerege 1 -> Naik 00015 #define PIN_OPTO_5 PB_4//LED Mati //Pelontar shagai 1 -> Panjang 00016 #define PIN_OPTO_7 PC_8 //Pencapit gerege 1 -> Buka 00017 #define PIN_OPTO_9 PC_5 //Pembelok gerege 1 -> Lurus 00018 #define PIN_OPTO_11 PB_2 //Pengambil shagai 1 -> Tutup 00019 00020 //Serial pin for UART Arduino 00021 #define PIN_TX PA_0 00022 #define PIN_RX PA_1 00023 00024 //Serial Initiate 00025 //Serial pc(USBTX, USBRX, 115200); 00026 joysticknucleo stick(PIN_TX, PIN_RX); 00027 00028 //Compass 00029 CMPS12_KRAI compass_sensor(PC_9,PA_8, 0xC0); 00030 00031 //Internal Encoder From Motor using interrupt 00032 encoderKRAI enc_right_top(PC_10, PC_13, 537.6, encoderKRAI::X4_ENCODING); 00033 encoderKRAI enc_left_top(PC_12, PC_11, 537.6, encoderKRAI::X4_ENCODING); 00034 encoderKRAI enc_left_back(PC_3, PC_2, 537.6, encoderKRAI::X4_ENCODING); 00035 encoderKRAI enc_right_back(PC_15, PC_14, 537.6, encoderKRAI::X4_ENCODING); 00036 encoderKRAI enc_shagai(PC_6, PC_7, 538, encoderKRAI::X4_ENCODING); 00037 00038 //input capture encoder 00039 // encoderHAL enc2(TIM4); 00040 // encoderHAL enc3(TIM2); 00041 // encoderHAL enc1(TIM3); 00042 00043 Motor motor_right_top(PA_11,PA_12,PB_12); 00044 Motor motor_left_top(PA_7,PA_5, PA_6); 00045 Motor motor_left_back(PB_0,PC_1, PC_0); 00046 Motor motor_right_back(PB_1,PB_14, PB_15); 00047 Motor motor_shagai(PA_15, PA_13, PA_14 ); 00048 00049 //Pneumatic 00050 DigitalOut pneumatic_extension (PIN_OPTO_3); 00051 DigitalOut pneumatic_penaik (PIN_OPTO_4); 00052 DigitalOut pneumatic_pelontar (PIN_OPTO_5); 00053 DigitalOut pneumatic_pencapit (PIN_OPTO_7); 00054 DigitalOut pneumatic_pembelok (PIN_OPTO_9); 00055 DigitalOut pneumatic_pengambil (PIN_OPTO_11); 00056 00057 #endif
Generated on Tue Jul 12 2022 22:57:42 by
