svoe
Dependencies: mbed mbed-STM32F103C8T6 MPU6050_1
Diff: main.cpp
- Revision:
- 15:960b922433d1
- Parent:
- 13:789b451cc27d
- Child:
- 17:bd6b6ac89e0e
- Child:
- 18:af32a5e7e8ae
--- a/main.cpp Sun Nov 18 13:33:28 2018 +0000 +++ b/main.cpp Sat Dec 01 14:25:04 2018 +0000 @@ -11,26 +11,25 @@ #include "system.h" #include "sound.h" - - int main() { - int k = 0; - wait_ms(1000); + int k; + wait_ms(500); system_init(); - //gyro_x=0, gyro_y=0, gyro_angle=0, gyro_v=0, gyro_s=0; - current.x = 0; + start_recognizer(); + play(1); while(1){ while(realtime_flag == 0){} + myled = 0; //inverse connection gyro.read(&gx,&gy,&gz,&ax,&ay,&az); //doesn't work in interrupt // reading - 500 uS - balance(); +//constant speed motion: distance_to_target = (x_diff/x_prop) * target.speed + balance_coord(); + //balance_motion(); if(external_command != 0) command_process(); - realtime_flag = 0; - k++; - //target.x = 0; - //target.y = 0; - if (k > 3596) { k = 0; } else { target.x = trajectory[int(k/400)][1];target.y = trajectory[int(k/400)][0]; } - //k++ ; target.x = 0.1*int(k/200); + voice_command_process(); + if (k++ > 1000) {k = 0;} else { target.x = trajectory[int(k/100)][0];target.y = trajectory[int(k/100)][1]; target.azimuth = trajectory[int(k/100)][2];} + realtime_flag = 0; myled = 1; } //while(1){proc_counter++;} } +