The subsystem design/basis for the final project
Dependencies: mbed-rtos mbed-src pixylib
main.cpp
- Committer:
- balsamfir
- Date:
- 2016-04-03
- Revision:
- 17:47e107f9587b
- Parent:
- 15:caa5a93a31d7
- Child:
- 18:501f1007a572
File content as of revision 17:47e107f9587b:
// Includes // ---------------------------------------------------------------- #include "global.h" #include "robot.h" // Definitions // ---------------------------------------------------------------- enum Mode { AUTO_TRACK = '0', MANUAL_CONTROL = '1', SYSTEM_TUNING = '2' }; void PrintMenu(Serial *pc); // Wiring - TODO // ---------------------------------------------------------------- // // // // // // // Main Program // ---------------------------------------------------------------- int main() { int mode; InitRobot(); 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 SYSTEM_TUNING: Tunning(); 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. System Tuning \r\n"); pc->printf("---------------------------------------------------------------- \r\n\r\n"); pc->printf("=> "); }