The subsystem design/basis for the final project
Dependencies: mbed-rtos mbed-src pixylib
global.h@3:dfb6733ae397, 2016-03-14 (annotated)
- Committer:
- balsamfir
- Date:
- Mon Mar 14 00:40:28 2016 +0000
- Revision:
- 3:dfb6733ae397
- Parent:
- 2:2bc519e14bae
- Child:
- 5:f655435d0782
Ported robot controls to new framework and got everything working and tested
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
balsamfir | 2:2bc519e14bae | 1 | #include "mbed.h" |
balsamfir | 2:2bc519e14bae | 2 | #include "rtos.h" |
balsamfir | 3:dfb6733ae397 | 3 | #include "Pixy.h" |
balsamfir | 2:2bc519e14bae | 4 | |
balsamfir | 2:2bc519e14bae | 5 | // ---------------------------------------------------------------- |
balsamfir | 2:2bc519e14bae | 6 | // Contains common defintions share between modes |
balsamfir | 2:2bc519e14bae | 7 | // ---------------------------------------------------------------- |
balsamfir | 2:2bc519e14bae | 8 | |
balsamfir | 2:2bc519e14bae | 9 | // IO Port |
balsamfir | 2:2bc519e14bae | 10 | extern DigitalOut led1; |
balsamfir | 2:2bc519e14bae | 11 | extern DigitalOut led2; |
balsamfir | 2:2bc519e14bae | 12 | extern DigitalOut led3; |
balsamfir | 2:2bc519e14bae | 13 | extern DigitalOut led4; |
balsamfir | 2:2bc519e14bae | 14 | extern DigitalOut leftDir; |
balsamfir | 2:2bc519e14bae | 15 | extern DigitalOut rightDir; |
balsamfir | 2:2bc519e14bae | 16 | extern DigitalOut spiReset; |
balsamfir | 2:2bc519e14bae | 17 | extern DigitalOut ioReset; |
balsamfir | 2:2bc519e14bae | 18 | |
balsamfir | 2:2bc519e14bae | 19 | // Comunication |
balsamfir | 2:2bc519e14bae | 20 | extern SPI deSpi; |
balsamfir | 3:dfb6733ae397 | 21 | extern Pixy pixy; |
balsamfir | 2:2bc519e14bae | 22 | extern Serial pc; // PC serial channel |
balsamfir | 2:2bc519e14bae | 23 | extern Serial bt; // Bluetooth serial channel |
balsamfir | 2:2bc519e14bae | 24 | |
balsamfir | 3:dfb6733ae397 | 25 | // Other |
balsamfir | 3:dfb6733ae397 | 26 | extern PwmOut leftPwm; |
balsamfir | 3:dfb6733ae397 | 27 | extern PwmOut rightPwm; |
balsamfir | 3:dfb6733ae397 | 28 | extern InterruptIn bumper; // External interrupt pin declared as Bumper |
balsamfir | 3:dfb6733ae397 | 29 | |
balsamfir | 2:2bc519e14bae | 30 | // Method prototypes |
balsamfir | 3:dfb6733ae397 | 31 | void PI(float error, float *output, float *integral, float kP, float kI, float bound); |
balsamfir | 3:dfb6733ae397 | 32 | float QE2RadsPerSec(short counts, short time); |