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 SpeedController
Diff: main.cpp
- Revision:
- 2:c4e456559941
- Parent:
- 1:0e8ec231cb2f
- Child:
- 3:e7807f60c9bf
diff -r 0e8ec231cb2f -r c4e456559941 main.cpp
--- 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]);