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.
Diff: main.cpp
- Revision:
- 20:c89685cd0b02
- Parent:
- 19:d3b82416df50
- Child:
- 21:d553c43a5a26
--- a/main.cpp Mon Dec 09 16:41:10 2019 +0000 +++ b/main.cpp Tue Dec 10 10:51:17 2019 +0000 @@ -93,11 +93,11 @@ float TA1 = 2.0f * (tA1[1]-tA1[0]); float TA2 = 2.0f * (tA2[1]-tA2[0]); float TA = (TA1 + TA2) * 0.5f; - trav = (175.9/20.8); + trav = (20.8*countA); float fA = 1.0f/ (TA *(float)3.0E-6); speedA = fA/20.8; - terminal.printf("WheelA: %6.2f \t WheelB: %6.2f \t trav: %d\n", speedA, speedB, countA); - if(countA >=21){ + terminal.printf("WheelA: %6.2f \t WheelB: %6.2f \t pulses: %d \t trav: %6.2f\n", speedA, speedB, countA, trav); + if(countA >=48){ PWMA.write(0.0f); PWMB.write(0.0f); wait(10000); @@ -194,8 +194,8 @@ //Wait - give time to start running wait(1.0); //Set initial motor speed to stop - PWMA.write(0.5f); //Set duty cycle (%) - PWMB.write(0.5f); //Set duty cycle (%) + PWMA.write(1.0f); //Set duty cycle (%) + PWMB.write(1.0f); //Set duty cycle (%) //Main polling loop while(1)