The subsystem design/basis for the final project
Dependencies: mbed-rtos mbed-src pixylib
main.cpp
- Committer:
- balsamfir
- Date:
- 2016-03-14
- Revision:
- 3:dfb6733ae397
- Parent:
- 2:2bc519e14bae
- Child:
- 4:01252f56e0e5
File content as of revision 3:dfb6733ae397:
// Includes // ---------------------------------------------------------------- #include "global.h" #include "robot.h" #include "response.h" #include "tuning.h" // Definitions // ---------------------------------------------------------------- enum Mode { AUTO_TRACK = '0', MANUAL_CONTROL = '1', PIXY_SUBSYSTEM = '2', MOTOR_RESPONSE = '3', SPEED_RESPONSE = '4', STEERING_RESPONSE = '5', TILT_RESPONSE = '6', MOTOR_TUNING = '7', SPEED_TUNING = '8', STEERING_TUNING = '9', TILT_TUNING = 'a' }; void PrintMenu(Serial *pc); // Wiring - TODO // ---------------------------------------------------------------- // // // // // // // Main Program // ---------------------------------------------------------------- int main() { int mode; while (1) { PrintMenu(&pc); mode = pc.getc(); pc.printf("\r\n\r\n"); switch (mode) { case AUTO_TRACK: AutoTrack(); break; case MANUAL_CONTROL: ManualControl(); break; case PIXY_SUBSYSTEM: PixySubsystem(); break; case MOTOR_RESPONSE: MotorResponse(); break; case SPEED_RESPONSE: SpeedResponse(); break; case STEERING_RESPONSE: SteeringResponse(); break; case TILT_RESPONSE: TiltResponse(); break; case MOTOR_TUNING: MotorTuning(); break; case SPEED_TUNING: SpeedTuning(); break; case STEERING_TUNING: SteeringTuning(); break; case TILT_TUNING: TiltTuning(); break; default: pc.printf("Error: Invalid Selection \r\n\r\n"); break; } wait_ms(2000); } } // Other Functions // ---------------------------------------------------------------- void PrintMenu(Serial *pc){ pc->printf("\e[1;1H\e[2J"); pc->printf("Select Mode: \r\n\r\n"); pc->printf("---------------------------------------------------------------- \r\n"); pc->printf("0. Automated Tracking \r\n"); pc->printf("1. Manual Control \r\n"); pc->printf("2. Pixy Subsystem \r\n"); pc->printf("3. Motor Response \r\n"); pc->printf("4. Speed Response \r\n"); pc->printf("5. Steering Response \r\n"); pc->printf("6. Tilt Response \r\n"); pc->printf("7. Motor Tunning \r\n"); pc->printf("8. Speed Tunning \r\n"); pc->printf("9. Steeing Tunning \r\n"); pc->printf("a. Tilit Tunning \r\n"); pc->printf("---------------------------------------------------------------- \r\n\r\n"); pc->printf("=> "); }