Main Program

Dependencies:   mbed AQM1602 HMC6352 PID

Revision:
22:a95f7c63af3c
Parent:
21:d69a8f3c76e1
Child:
23:d95d8d3e89f3
--- a/main_processing/setup_command_active/command.cpp	Sat Jan 30 09:02:03 2016 +0000
+++ b/main_processing/setup_command_active/command.cpp	Sat Jan 30 09:27:51 2016 +0000
@@ -78,7 +78,7 @@
 uint8_t LoopFunction0(uint8_t x){
     char buf[0x10];
     sprintf(buf, "CAR%d", x);
-    Lcd.locate(0, 1);Lcd.print(buf);return 0;
+    Lcd.locate(0, 1);Lcd.print(buf);wait_ms(50);return 0;
 }
 uint8_t LoopFunction1(uint8_t x){
     char buf[0x10];
@@ -90,7 +90,7 @@
 uint8_t LoopFunction2(uint8_t x){
     char buf[0x10];
     sprintf(buf, "RR%d", x);
-    Lcd.locate(0, 1);Lcd.print(buf);return 0;
+    Lcd.locate(0, 1);Lcd.print(buf);wait_ms(50);return 0;
 }
 uint8_t LoopFunction3(uint8_t x){ return 0; }
 uint8_t LoopFunction4(uint8_t x){
@@ -103,16 +103,44 @@
     line[1] = (0x2 & linedata)>>1;
     line[0] = (0x1 & linedata)>>0;
     sprintf(buf, "A:%1d B:%1d C:%1d ", line[2], line[1], line[0]);
-    Lcd.locate(0, 1);Lcd.print(buf);return 0;
+    Lcd.locate(0, 1);Lcd.print(buf);wait_ms(50);return 0;
 }
-uint8_t LoopFunction5(uint8_t x){ return 0; }
-uint8_t LoopFunction6(uint8_t x){ return 0; }
+uint8_t LoopFunction5(uint8_t x){
+    char buf[0x10];
+    sprintf(buf, "Enter");
+    Lcd.locate(0, 1);Lcd.print(buf);
+    hmc.setCalibrationMode(HMC6352_EXIT_CALIB);
+    return 1;
+}
+uint8_t LoopFunction6(uint8_t x){
+    char buf[0x10];
+    sprintf(buf, "Exit");
+    Lcd.locate(0, 1);Lcd.print(buf);
+    hmc.setCalibrationMode(HMC6352_ENTER_CALIB);
+    return 1;
+}
 uint8_t LoopFunction7(uint8_t x){ return 0; }
 uint8_t LoopFunction8(uint8_t x){ return 0; }
 uint8_t LoopFunction9(uint8_t x){ return 0; }
 uint8_t LoopFunctionA(uint8_t x){ return 0; }
-uint8_t LoopFunctionB(uint8_t x){ return 0; }
-uint8_t LoopFunctionC(uint8_t x){ return 0; }
+uint8_t LoopFunctionB(uint8_t x){
+    char buf[0x10];
+    if(x==1) data.strategy = 6;
+    if(x==2) data.strategy = 7;
+    if(x==3) data.strategy = 8;
+    data.init_point_flag=1;
+    sprintf(buf, "Make a strategy");
+    Lcd.locate(0, 1);Lcd.print(buf);return 0;
+}
+uint8_t LoopFunctionC(uint8_t x){
+    char buf[0x10];
+    if(x==1) data.strategy = 9;
+    if(x==2) data.strategy = 10;
+    if(x==3) data.strategy = 11;
+    data.init_point_flag=1;
+    sprintf(buf, "Make a strategy");
+    Lcd.locate(0, 1);Lcd.print(buf);return 0;
+}
 uint8_t LoopFunctionD(uint8_t x){
     char buf[0x10];
     if(x==1) data.strategy = 0;