svoe
Dependencies: mbed mbed-STM32F103C8T6 MPU6050_1
main.cpp
- Committer:
- Stas285
- Date:
- 2017-05-14
- Revision:
- 4:904b737ef08a
- Parent:
- 3:8e8458f45d19
- Child:
- 6:6e89cdc3db92
File content as of revision 4:904b737ef08a:
#include "stm32f103c8t6.h" #include "mbed.h" #include "common.h" #include "gyro.h" #include "motor.h" #include "serva.h" #include "echo.h" #include "motion.h" #include "wifi.h" #include "realtime.h" #include "system.h" int main() { system_init(); stop(); wait(2); gyro_x=0, gyro_y=0, gyro_angle=0, gyro_v=0, gyro_s=0; external_command = 0xff; /* MPU6050 gyro(PB_9,PB_8); pc.printf("%hu ::",gyro.getID()); pc.printf("%hu ::",gyro.getID()); pc.printf("%hu ::",gyro.getID()); pc.printf("%hu ::",gyro.getID()); I2C i2c(PB_9,PB_8); i2c.frequency(400000); int tmaddr = 0xD1; char tmdata = 117; pc.printf("%hhu, ",i2c.write(tmaddr, &tmdata,1)); pc.printf("%hhu, ",i2c.write(tmaddr, &tmdata,1)); pc.printf("%hhu: ",i2c.read(tmaddr,&tmdata,1)); pc.printf("%hhu; \n",tmdata); */ while(1){ while(realtime_flag == 0){} if(external_command != 0) command_process(); wait_ms(40); //blocking gyro_process(); //doesn't work in interrupt } //while(1){proc_counter++;} // dance(10,5); } //check_battery;