Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed QEI HIDScope biquadFilter MODSERIAL FastPWM demomode
Diff: main.cpp
- Revision:
- 25:00488a279da1
- Parent:
- 24:0b5b7ec374e6
- Child:
- 28:5250ef542ffd
--- a/main.cpp Fri Oct 04 10:43:52 2019 +0000 +++ b/main.cpp Mon Oct 07 07:44:11 2019 +0000 @@ -50,8 +50,8 @@ void main_loop() { - double y_des = pot1.read(); - motor_position(y_des); + double potpos = pot1.read(); + motor_position(potpos); } @@ -59,7 +59,7 @@ { motor1_dir.write(motordir1); motor2_dir.write(motordir2); - ticker.attach(&main_loop, 0.1f); + ticker.attach(&main_loop, 0.001f); while(true){ pc.printf("pot1(%f),enc1 is (%d),pot2(%f),enc2 is (%d)\r\n",pot1.read(),encoder.getPulses(),pot2.read(),encoder_2.getPulses()); wait(0.1f);