svoe
Dependencies: mbed mbed-STM32F103C8T6 MPU6050_1
Diff: motor.h
- Revision:
- 4:904b737ef08a
- Parent:
- 0:e9488589a8ee
- Child:
- 6:6e89cdc3db92
--- a/motor.h Sun May 07 08:37:22 2017 +0000 +++ b/motor.h Sun May 14 11:28:29 2017 +0000 @@ -14,6 +14,7 @@ if ((-motor_target_speed + motor_speed[right]) > accel) {motor_speed[right] = motor_speed[right] - accel;} // calculate new curent speed if ((-motor_speed[right] + motor_target_speed) > accel) motor_speed[right] = motor_speed[right] + accel; // calculate new curent speed if (abs(-motor_target_speed + motor_speed[right]) <= accel) motor_speed[right] = motor_target_speed; // calculate new curent speed + motor_speed[right] -= 2*ay; if (right) {if (motor_speed[right] > 0) dir_right = 1; else dir_right = 0;} else {if (motor_speed[right] > 0) dir_left = 0; else dir_left = 1;} nu_l = abs(motor_speed[right])*500/3.8; //frequency in herz !!!!(cm) @@ -25,5 +26,5 @@ void motor_init(){ step_left = 0.5; step_right = 0.5; motor_enable = 1; - skorost(0,0.1); skorost(1,0.1); + skorost(0,0.01); skorost(1,0.01); } \ No newline at end of file