svoe

Dependencies:   mbed mbed-STM32F103C8T6 MPU6050_1

Revision:
9:8f98b1c277a4
Parent:
8:891e4f54e9e2
Child:
10:5bdd3dfd5f59
--- a/realtime.h	Fri Aug 18 08:53:15 2017 +0000
+++ b/realtime.h	Sat Sep 16 13:24:25 2017 +0000
@@ -2,19 +2,19 @@
 float rt_delta;
 bool realtime_flag;
 
+
 void realtime(){ //35uS - (3.5mS @ 115200) - (500uS @ 921600) (w/o sin,cos)
-    myled = !myled;
-//    test = 1;
+    //test = 1;
 
-//geometric navigation    
-    rt_delta = (motor_speed[1]+motor_speed[0])/2.0*0.05; 
+//geometric navigation                                                              MOVE TO SKOROST!!!!!
+/*    rt_delta = (motor_speed[1]+motor_speed[0])/2.0*0.05; 
     current_angle += (motor_speed[0]-motor_speed[1])*0.05/16.0*57.3;//deg
     current_path += rt_delta;
     current_x += rt_delta*sin(current_angle/57.3);
-    current_y += rt_delta*cos(current_angle/57.3);
+    current_y += rt_delta*cos(current_angle/57.3);*/
 //pc.printf("%3.1f - %3.1f ; %3.1f - %3.1f ; %d\n",target_path,current_path,target_angle,current_angle,motor_busy); //be careful in interrupt
     
-    if(motor_busy == 1) {
+    /*if(motor_busy == 1) {
         if(stop_flag == 1) {skorost(0,0);skorost(1,0);if(abs(motor_speed[0])<1) motor_busy = 0;} //Stop with accel
         else { //motion
             if(infinite_flag == 1){skorost(1,speed*(1-half_width/radius));skorost(0,speed*(1+half_width/radius));}
@@ -38,14 +38,19 @@
                     }
                 }
             }
-       }     
-   echo_step(1);
+       }     */
+   //echo_step(1);
+   
+   skorost_1(0,0);
+   
    realtime_flag = 1; 
+   
+   
     
-//    test = 0;
+   // test = 0;
     //pc.printf("%d \n", proc_counter); proc_counter = 0;
   }
   
 void realtime_init(){
-    rt_ticker.attach_us(&realtime, 10000);
+    rt_ticker.attach(&realtime, 0.01);
     }
\ No newline at end of file