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.
pins.cpp@4:48d390356fba, 2018-02-22 (annotated)
- Committer:
- Weranest
- Date:
- Thu Feb 22 17:01:00 2018 +0000
- Revision:
- 4:48d390356fba
- Parent:
- 3:c9df852ad9ac
Tech Demo version
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Weranest | 0:62e51b80d738 | 1 | //This file is strictly to define pins for buggy operations. Thats it. But thought it would be easier to overseer them like this |
Weranest | 1:12f18cede014 | 2 | #include "mbed.h" |
Weranest | 1:12f18cede014 | 3 | #include "C12832.h" |
Weranest | 1:12f18cede014 | 4 | #include "pins.h" |
Weranest | 3:c9df852ad9ac | 5 | #include "QEI.h" |
Weranest | 3:c9df852ad9ac | 6 | #include "constants.cpp" |
Weranest | 4:48d390356fba | 7 | #include "C12832.h" |
Weranest | 0:62e51b80d738 | 8 | //Encoder pins (created as a QEI object, so just defined naming for pins) |
Weranest | 0:62e51b80d738 | 9 | //======================= |
Weranest | 3:c9df852ad9ac | 10 | #define channelARight PB_1 |
Weranest | 3:c9df852ad9ac | 11 | #define channelBRight PC_4 |
Weranest | 3:c9df852ad9ac | 12 | #define channelIRight PC_5 |
Weranest | 3:c9df852ad9ac | 13 | #define channelALeft PC_2 |
Weranest | 3:c9df852ad9ac | 14 | #define channelBLeft PC_3 |
Weranest | 3:c9df852ad9ac | 15 | #define channelILeft PC_6 |
Weranest | 3:c9df852ad9ac | 16 | QEI encoderRight(channelARight, channelBRight, channelIRight, ENCODER_PULSE); |
Weranest | 3:c9df852ad9ac | 17 | QEI encoderLeft(channelALeft, channelBLeft, channelILeft, ENCODER_PULSE); |
Weranest | 0:62e51b80d738 | 18 | //Motor control pins |
Weranest | 0:62e51b80d738 | 19 | //======================= |
Weranest | 4:48d390356fba | 20 | PwmOut motorRight(PB_7); |
Weranest | 4:48d390356fba | 21 | PwmOut motorLeft(PC_8); |
Weranest | 4:48d390356fba | 22 | DigitalOut motorDirRight(PH_0); |
Weranest | 0:62e51b80d738 | 23 | DigitalOut motorDirLeft(PB_5); |
Weranest | 4:48d390356fba | 24 | DigitalOut motorModeRight(PC_15); |
Weranest | 4:48d390356fba | 25 | DigitalOut motorModeLeft(PB_4); |
Weranest | 4:48d390356fba | 26 | DigitalOut driveBoard (PB_2); |
Weranest | 0:62e51b80d738 | 27 | //Line sensor pins |
Weranest | 0:62e51b80d738 | 28 | //======================= |
Weranest | 3:c9df852ad9ac | 29 | //UI pins(setup for control) |
Weranest | 3:c9df852ad9ac | 30 | //======================= |
Weranest | 4:48d390356fba | 31 | C12832 lcd(D11, D13, D12, D7, D10); |
Weranest | 4:48d390356fba | 32 | AnalogIn potentiometerLeft(PA_1); |
Weranest | 4:48d390356fba | 33 | AnalogIn potentiometerRight(PA_0); |
Weranest | 4:48d390356fba | 34 | DigitalIn joystickCentre(PB_10); |
Weranest | 3:c9df852ad9ac | 35 | DigitalIn joystickDown(PB_0); |
Weranest | 0:62e51b80d738 | 36 | //Magnet sensor pins |
Weranest | 0:62e51b80d738 | 37 | //======================= |