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: pins.cpp
- Revision:
- 3:c9df852ad9ac
- Parent:
- 1:12f18cede014
- Child:
- 4:48d390356fba
diff -r 7f4be54c7257 -r c9df852ad9ac pins.cpp --- a/pins.cpp Fri Feb 16 19:30:19 2018 +0000 +++ b/pins.cpp Wed Feb 21 11:55:29 2018 +0000 @@ -2,14 +2,18 @@ #include "mbed.h" #include "C12832.h" #include "pins.h" +#include "QEI.h" +#include "constants.cpp" //Encoder pins (created as a QEI object, so just defined naming for pins) //======================= -#define channelARight PA_1 -#define channelBRight -#define channelIRight -#define channelALeft -#define channelBLeft -#define channelILeft +#define channelARight PB_1 +#define channelBRight PC_4 +#define channelIRight PC_5 +#define channelALeft PC_2 +#define channelBLeft PC_3 +#define channelILeft PC_6 +QEI encoderRight(channelARight, channelBRight, channelIRight, ENCODER_PULSE); +QEI encoderLeft(channelALeft, channelBLeft, channelILeft, ENCODER_PULSE); //Motor control pins //======================= PwmOut motorRight(PB_6); @@ -21,5 +25,11 @@ DigitalOut driveBoard (PB_1); //Line sensor pins //======================= +//UI pins(setup for control) +//======================= +AnalogIn potLeft(PA_0); +AnalogIn potRight(PA_1); +DigitalIn joystickCentre(PB_5); +DigitalIn joystickDown(PB_0); //Magnet sensor pins //=======================