The subsystem design/basis for the final project
Dependencies: mbed-rtos mbed-src pixylib
Diff: global.cpp
- Revision:
- 6:52686c25e4af
- Parent:
- 5:f655435d0782
- Child:
- 7:5ef312aa2678
--- a/global.cpp Fri Mar 25 13:36:14 2016 +0000 +++ b/global.cpp Fri Mar 25 15:18:33 2016 +0000 @@ -5,27 +5,27 @@ DigitalOut led2(LED2); DigitalOut led3(LED3); DigitalOut led4(LED4); -DigitalOut leftDir(p29); -DigitalOut rightDir(p30); -DigitalOut spiReset(p11); -DigitalOut ioReset(p12); +DigitalOut leftDir(p24); // +DigitalOut rightDir(p22); // +DigitalOut spiReset(p8); //changed +DigitalOut ioReset(p14); // // Comunication SPI deSpi(p5, p6, p7); Pixy pixy(Pixy::SPI, p11, p12, p13); Serial pc(USBTX, USBRX); // PC serial channel -Serial bt(p9, p10); // Bluetooth serial channel +Serial bt(p28, p27); // Bluetooth serial channel // Control -PI leftMotorPi(MOTOR_PERIOD, MOTOR_KP, MOTOR_KI); -PI rightMotorPi(MOTOR_PERIOD, MOTOR_KP, MOTOR_KI); -PI targetHeightPi(NAVIGATION_PERIOD, SPEED_KP SPEED_KI); -PI targetXPi(NAVIGATION_PERIOD, STEERING_KP, STEERING_KI); +PeriodicPI leftMotorPI(MOTOR_PERIOD, MOTOR_KP, MOTOR_KI); +PeriodicPI rightMotorPI(MOTOR_PERIOD, MOTOR_KP, MOTOR_KI); +PeriodicPI heightPI(NAVIGATION_PERIOD, SPEED_KP, SPEED_KI); +PeriodicPI xPI(NAVIGATION_PERIOD, STEERING_KP, STEERING_KI); // Other -PwmOut leftPwm(p21); -PwmOut rightPwm(p22); -InterruptIn bumper(p8); +PwmOut leftPwm(p23); // +PwmOut rightPwm(p21); // +InterruptIn bumper(p25); // Converts measurements from the QE2 to rads/sec float QE2RadsPerSec(short counts, short time) {