
2月25日
Dependencies: mbed SpeedController2_25 ros_lib_kinetic
Diff: main.cpp
- Revision:
- 2:c4e456559941
- Parent:
- 1:0e8ec231cb2f
- Child:
- 3:e7807f60c9bf
--- a/main.cpp Fri Nov 08 05:23:55 2019 +0000 +++ b/main.cpp Fri Nov 08 06:36:17 2019 +0000 @@ -35,9 +35,10 @@ else motor_1.Sc(rotate_1); if(rotate_2==0) motor_2.stop(); else motor_2.Sc(rotate_2); + EC_1.calOmega(); + EC_2.calOmega(); j++; } - int main() { motor_1.period_us(50); @@ -49,12 +50,10 @@ motor_tick.attach(&CalOmega,0.05); while(1) { - if(pc.readable()) { char sel=pc.getc(); if(sel=='q') { for(int i=0; i<1000; i++) { - // pc.printf("%f ",time_when[i]); pc.printf("%f,%f ",motor1_omega[i],motor2_omega[i]); pc.printf("%d,%d\r\n",motor1_count[i],motor2_count[i]);