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.
Diff: PinDefinedSetting.h
- Revision:
- 9:f9a0c7ca640f
- Child:
- 11:565fca1ead5b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PinDefinedSetting.h Mon Nov 02 08:44:37 2015 +0000 @@ -0,0 +1,83 @@ +/** + * This define list is included main.cpp. + * Defined pins for each function. + */ + +#ifndef PIN_DEFINE_BLUE_H +#define PIN_DEFINE_BLUE_H + +///////////////////////////////////////////////////////////////////////// + +/** + * Defines + */ + +/****The pin is to conect to encoder which sense migration length****/ +#ifdef BLUE +#define ENCOD_MOVE_R_A p26 +#define ENCOD_MOVE_R_B p25 +#else +#define ENCOD_MOVE_R_A p30 +#define ENCOD_MOVE_R_B p29 +#endif +QEI Move_r_sense(ENCOD_MOVE_R_A, ENCOD_MOVE_R_B, NC, 400, QEI::X4_ENCODING); + +/****The pin is to conect to encoder which sense migration length****/ +#ifdef BLUE +#define ENCOD_MOVE_L_A p29 +#define ENCOD_MOVE_L_B p30 +#else +#define ENCOD_MOVE_L_A p25 +#define ENCOD_MOVE_L_B p26 +#endif +QEI Move_l_sense(ENCOD_MOVE_L_A, ENCOD_MOVE_L_B, NC, 400, QEI::X4_ENCODING); + +/****The pin is to conect to motor which to move.****/ +#ifdef BLUE +#define MOTOR_MOVE_R_CW p18 +#define MOTOR_MOVE_R_CCW p21 +#define MOTOR_MOVE_R_PWM p22 +#else +#define MOTOR_MOVE_R_CW p19 +#define MOTOR_MOVE_R_CCW p20 +#define MOTOR_MOVE_R_PWM p23 +#endif +DigitalOut Move_r_Motor_CW(MOTOR_MOVE_R_CW); +DigitalOut Move_r_Motor_CCW(MOTOR_MOVE_R_CCW); +PwmOut Move_r_Motor_PWM(MOTOR_MOVE_R_PWM); + +/****The pin is to conect to motor which to move.****/ +#ifdef BLUE +#define MOTOR_MOVE_L_CW p20 +#define MOTOR_MOVE_L_CCW p19 +#define MOTOR_MOVE_L_PWM p23 +#else +#define MOTOR_MOVE_L_CW p21 +#define MOTOR_MOVE_L_CCW p18 +#define MOTOR_MOVE_L_PWM p22 +#endif +DigitalOut Move_l_Motor_CW(MOTOR_MOVE_L_CW); +DigitalOut Move_l_Motor_CCW(MOTOR_MOVE_L_CCW); +PwmOut Move_l_Motor_PWM(MOTOR_MOVE_L_PWM); + +/***The pin is to conect to swing motor and interrupter.***/ +#define MOTOR_SWING_PWM p24 +PwmOut Motor_swing(MOTOR_SWING_PWM); +#define ENCOD_SWING_A p12 +#define ENCOD_SWING_B p11 +#define ENCOD_SWING_Z p15 +QEI SwingSens(ENCOD_SWING_A, ENCOD_SWING_B, ENCOD_SWING_Z, 360, QEI::X4_ENCODING); +#define INTERRUPTER p16 +InterruptIn interrupter(INTERRUPTER); + +/***indicator***/ +DigitalOut Indicator1(LED1); +DigitalOut Indicator2(LED2); +DigitalOut Indicator3(LED3); +DigitalOut Indicator4(LED4); +DigitalOut IndicatorAuto(p17); +DigitalOut IndicatorBLUE(p6); +DigitalOut IndicatorRED(p5); +///////////////////////////////////////////////////////////////////////// + +#endif /*PinDefine.h*/ \ No newline at end of file