6/18 wallbot

Dependencies:   mbed

Fork of BLE_WallbotBLE_Challenge_byYUTAKA by Yutaka Yoshida

Revision:
8:102c19510dce
Parent:
7:897b9ded86e2
Child:
9:965bfb378463
diff -r 897b9ded86e2 -r 102c19510dce main.cpp
--- a/main.cpp	Tue Jun 12 04:17:48 2018 +0000
+++ b/main.cpp	Tue Jun 12 04:24:05 2018 +0000
@@ -480,7 +480,7 @@
                 break;
             case 3:                 // Up Rotate
                 pc.printf("Mode 3 \n");
-                if(!(ax < -9.5 && ay < 0.5 && ay >= -0.3))
+                if(!(ax < -9.5 && ay < 0.5 && ay >= -0.3))      // Change Using Gyro??
                 {
                     left = 1.0;
                     right = 0;                    
@@ -490,6 +490,10 @@
                         stt_Mode = 4;
                         pc.printf("Mode 3 - > 4 \n");
                         
+                        for(int i = 0; i < 10; i++)
+                        {
+                            buf_ax[i] = ax;
+                            }
                         }
                 
                 break;
@@ -535,7 +539,7 @@
                 break;
             case 6:                 //
                 pc.printf("Mode 6 \n");
-                if(!(ax > 9.5 && ay < 0.5 && ay >= 0))
+                if(!(ax > 9.5 && ay < 0.5 && ay >= 0))      // Change Using Gyro??
                 {
                     left = 0;
                     right = 1.0;                    
@@ -544,6 +548,12 @@
                     {
                         stt_Mode = 1;
                         pc.printf(" 6 -> 1 \n");
+                        
+                        for(int i = 0; i < 10; i++)
+                        {
+                            buf_ax[i] = ax;
+                            }
+                        }
                         }
                 
                 break;