svoe
Dependencies: mbed mbed-STM32F103C8T6 MPU6050_1
Diff: motion.h
- Revision:
- 1:e2a6e523bf1f
- Parent:
- 0:e9488589a8ee
- Child:
- 4:904b737ef08a
--- a/motion.h Tue May 02 16:50:18 2017 +0000 +++ b/motion.h Sat May 06 18:21:55 2017 +0000 @@ -13,6 +13,7 @@ bool angle_dir; bool angle_task;//1 - angle, 0 - path bool stop_flag = 0; +bool infinite_flag = 0; //Timer trap_timer; @@ -22,7 +23,7 @@ void go(int cm, bool brake = 1){ if(cm != 0) { - stop_flag = 0; + stop_flag = 0; infinite_flag = 0; motor_enable = 1; target_path =old_path + cm; old_path = target_path; if(cm > 0) path_dir = 1; else path_dir = 0; @@ -34,7 +35,7 @@ void turn(int deg, bool brake = 1){ if(deg != 0) { - stop_flag = 0; + stop_flag = 0; infinite_flag = 0; motor_enable = 1; target_angle = old_angle + deg; old_angle = target_angle; if(deg > 0) angle_dir = 1; else angle_dir = 0;