svoe

Dependencies:   mbed mbed-STM32F103C8T6 MPU6050_1

Revision:
9:8f98b1c277a4
Parent:
8:891e4f54e9e2
Child:
10:5bdd3dfd5f59
--- a/main.cpp	Fri Aug 18 08:53:15 2017 +0000
+++ b/main.cpp	Sat Sep 16 13:24:25 2017 +0000
@@ -13,15 +13,16 @@
 #include "sound.h"
 
 int main() {
-    wait(2);
     system_init();
 //    usb_serial.printf("I am a USB serial port\r\n");
-    stop(); wait(2);
+    //stop();
     gyro_x=0, gyro_y=0, gyro_angle=0, gyro_v=0, gyro_s=0;
     play(21);
-    go(1);
-    stop();
-    go(5);
+    /*go(1);
+    stop();*/
+    speed = 10;radius = 1e5;
+    infinite_flag = 1;motor_busy = 1;stop_flag = 0;
+    //go(5);
     //external_command = 0xff;
 
 /*    MPU6050 gyro(PB_9,PB_8);
@@ -40,11 +41,16 @@
     pc.printf("%hhu; \n",tmdata);
 */    
     while(1){
+        //pc.printf("mhgc");
         while(realtime_flag == 0){}
-        //if(external_command != 0) command_process();
+        
+        if(external_command != 0) command_process();
         //wait_ms(40); //blocking
+        gy_old = gy;
         gyro_process(); //doesn't work in interrupt
-        wifi.printf("%.2f ",motor_speed[1]);
+        //pc.printf("ax:%.2f",ax);
+       //if (infinite_flag == 1) wifi.printf("%.4f %.2f %.2f; ",ax,gz,motor_speed[1]);
+       //wifi.printf("%.4f %.2f %.2f ",ax,ax,ax);
         realtime_flag = 0;
         }
     //while(1){proc_counter++;}