svoe
Dependencies: mbed mbed-STM32F103C8T6 MPU6050_1
main.cpp@15:960b922433d1, 2018-12-01 (annotated)
- Committer:
- Stas285
- Date:
- Sat Dec 01 14:25:04 2018 +0000
- Revision:
- 15:960b922433d1
- Parent:
- 13:789b451cc27d
- Child:
- 17:bd6b6ac89e0e
- Child:
- 18:af32a5e7e8ae
coord_ready
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Stas285 | 0:e9488589a8ee | 1 | #include "stm32f103c8t6.h" |
Stas285 | 0:e9488589a8ee | 2 | #include "mbed.h" |
Stas285 | 1:e2a6e523bf1f | 3 | #include "common.h" |
Stas285 | 4:904b737ef08a | 4 | #include "gyro.h" |
Stas285 | 0:e9488589a8ee | 5 | #include "motor.h" |
Stas285 | 0:e9488589a8ee | 6 | #include "serva.h" |
Stas285 | 0:e9488589a8ee | 7 | #include "echo.h" |
Stas285 | 0:e9488589a8ee | 8 | #include "motion.h" |
Stas285 | 1:e2a6e523bf1f | 9 | #include "wifi.h" |
Stas285 | 0:e9488589a8ee | 10 | #include "realtime.h" |
Stas285 | 0:e9488589a8ee | 11 | #include "system.h" |
Stas285 | 6:6e89cdc3db92 | 12 | #include "sound.h" |
Stas285 | 0:e9488589a8ee | 13 | |
Stas285 | 0:e9488589a8ee | 14 | int main() { |
Stas285 | 15:960b922433d1 | 15 | int k; |
Stas285 | 15:960b922433d1 | 16 | wait_ms(500); |
Stas285 | 0:e9488589a8ee | 17 | system_init(); |
Stas285 | 15:960b922433d1 | 18 | start_recognizer(); |
Stas285 | 15:960b922433d1 | 19 | play(1); |
dima285 | 10:5bdd3dfd5f59 | 20 | |
dima285 | 12:721a9ea55e91 | 21 | while(1){ |
Stas285 | 4:904b737ef08a | 22 | while(realtime_flag == 0){} |
Stas285 | 15:960b922433d1 | 23 | myled = 0; //inverse connection |
dima285 | 12:721a9ea55e91 | 24 | gyro.read(&gx,&gy,&gz,&ax,&ay,&az); //doesn't work in interrupt // reading - 500 uS |
Stas285 | 15:960b922433d1 | 25 | //constant speed motion: distance_to_target = (x_diff/x_prop) * target.speed |
Stas285 | 15:960b922433d1 | 26 | balance_coord(); |
Stas285 | 15:960b922433d1 | 27 | //balance_motion(); |
dima285 | 9:8f98b1c277a4 | 28 | if(external_command != 0) command_process(); |
Stas285 | 15:960b922433d1 | 29 | voice_command_process(); |
Stas285 | 15:960b922433d1 | 30 | 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];} |
Stas285 | 15:960b922433d1 | 31 | realtime_flag = 0; myled = 1; |
Stas285 | 4:904b737ef08a | 32 | } |
Stas285 | 0:e9488589a8ee | 33 | //while(1){proc_counter++;} |
Stas285 | 0:e9488589a8ee | 34 | } |
Stas285 | 15:960b922433d1 | 35 |