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 MODSERIAL QEI
Diff: main.cpp
- Revision:
- 5:d1d65e16fd9e
- Parent:
- 4:2b3fbd7ef1cf
- Child:
- 6:e6a048f541ee
--- a/main.cpp Fri Sep 30 09:16:26 2016 +0000
+++ b/main.cpp Fri Sep 30 09:31:26 2016 +0000
@@ -34,8 +34,14 @@
motor1 = 1;
pwm_motor1 = 1;
wait (0.05);
+ pwm_motor1 = 0.75;
+ wait (0.01);
+ pwm_motor1 = 0.5;
+ wait (0.01);
+ pwm_motor1 = 0.25;
+ wait (0.01);
+ pwm_motor1 = 0;
}
- pwm_motor1 = 0;
else // als s is ingedrukt maar het getal is niet even (dus oneven) gebeurdt het onderstaande
{
pc.printf("n is odd \n\r"); // print lijn "n is odd"
@@ -43,8 +49,14 @@
motor2 = 1;
pwm_motor2 = 1;
wait (0.05);
- }
- pwm_motor2 = 0;
+ pwm_motor2 = 0.75;
+ wait (0.01);
+ pwm_motor2 = 0.5;
+ wait (0.01);
+ pwm_motor2 = 0.25;
+ wait (0.01);
+ pwm_motor2 = 0;
+ }
}
else if (c=='d') // als d ingedrukt wordt gebeurd het volgende
{
@@ -55,18 +67,29 @@
motor1 = 0;
pwm_motor1 = 1;
wait (0.05);
-
+ pwm_motor1 = 0.75;
+ wait (0.01);
+ pwm_motor1 = 0.5;
+ wait (0.01);
+ pwm_motor1 = 0.25;
+ wait (0.01);
+ pwm_motor1 = 0;
}
- pwm_motor1 = 0;
else // als d is ingedrukt maar het getal is niet even (dus oneven) gebeurdt het onderstaande
{
pc.printf("n is odd \n\r"); // print lijn "n is odd"
pc.printf("right \n\r"); // print lijn "right"
motor2 = 0;
pwm_motor2 = 1;
- wait (0.05);
- }
- pwm_motor2=0;
+ wait (0.05);
+ pwm_motor2 = 0.75;
+ wait (0.01);
+ pwm_motor2 = 0.5;
+ wait (0.01);
+ pwm_motor2 = 0.25;
+ wait (0.01);
+ pwm_motor2 = 0;
+ }
}
}