C++ Library for the PsiSwarm Robot - Version 0.7
Fork of PsiSwarmV7 by
Diff: demo.cpp
- Revision:
- 4:1c621cb8cf0d
- Parent:
- 2:c6986ee3c7c5
- Child:
- 5:3cdd1a37cdd7
--- a/demo.cpp Tue Mar 15 00:58:09 2016 +0000 +++ b/demo.cpp Wed Aug 03 12:25:23 2016 +0000 @@ -5,8 +5,9 @@ * (C) Dept. Electronics & Computer Science, University of York * James Hilder, Alan Millard, Alexander Horsfield, Homero Elizondo, Jon Timmis * - * PsiSwarm Library Version: 0.41 + * PsiSwarm Library Version: 0.5 * + * Version 0.5 : Added motor calibration menu * Version 0.4 : Added PsiSwarmBasic menu * Version 0.2 : Remove most the functionality from center-button push to allow all operations to be accessable from * four directions alone. @@ -124,7 +125,7 @@ case 1: //Up pressed switch(level) { case 0: - if(top_menu != 6) { + if(top_menu != 8) { level++; sub_menu = 0; } else { @@ -286,7 +287,7 @@ case 2: //Down pressed switch(level) { case 0: - if(top_menu != 6) { + if(top_menu != 8) { level++; sub_menu = 0; } else { @@ -452,10 +453,12 @@ switch(level) { case 0: if(top_menu == 0) { - top_menu = 6; - if(use_flash_basic == 1) top_menu = 7; + top_menu = 8; } - else top_menu --; + else { + if(use_flash_basic == 0 && top_menu == 7) top_menu = 6; + top_menu --; + } break; case 1: switch(top_menu) { @@ -480,6 +483,10 @@ if(sub_menu == 0) sub_menu = 4; else sub_menu --; break; + case 6: //Calibrate Menu + if(sub_menu == 0) sub_menu = 2; + else sub_menu --; + break; case 7: //PsiBasic Menu if(sub_menu == 0) sub_menu = psi_basic_file_count; else sub_menu --; @@ -492,7 +499,7 @@ switch(level) { case 0: top_menu ++; - if((top_menu - use_flash_basic) > 6) top_menu = 0; + if((top_menu - use_flash_basic) > 7) top_menu = 0; break; case 1: switch(top_menu) { @@ -516,6 +523,10 @@ if(sub_menu == 4) sub_menu = 0; else sub_menu ++; break; + case 6: //Calibrate Menu + if(sub_menu == 2) sub_menu = 0; + else sub_menu ++; + break; case 7: //PsiBasic Menu if(sub_menu == psi_basic_file_count) sub_menu = 0; else sub_menu ++; @@ -526,7 +537,7 @@ case 16: //Select pressed switch(level) { case 0: - if(top_menu != 6) { + if(top_menu != 8) { level++; sub_menu = 0; } else { @@ -584,6 +595,9 @@ case 5: // Demo Menu if(sub_menu == 4) level = 0; break; + case 6: // Calibrate Menu + if(sub_menu == 2) level = 0; + break; case 7: // PsiBasic Menu if(sub_menu == psi_basic_file_count) level = 0; break; @@ -617,11 +631,14 @@ strcpy(topline,"---CODE DEMOS---"); break; case 6: - strcpy(topline,"------EXIT------"); + strcpy(topline,"-MOTOR CALIBRATE"); break; case 7: strcpy(topline,"---PSI BASIC----"); break; + case 8: + strcpy(topline,"------EXIT------"); + break; } strcpy(bottomline,""); break; @@ -834,7 +851,18 @@ } break; case 6: - strcpy(topline,""); + strcpy(topline,"-MOTOR CALIBRATE"); + switch(sub_menu) { + case 0: + sprintf(bottomline,"RUN A3 TEST"); + break; + case 1: + sprintf(bottomline,"ENTER VALUE"); + break; + case 2: + sprintf(bottomline,"EXIT"); + break; + } break; } break;