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:
- 7:9dc08a9a5991
- Parent:
- 4:2b3fbd7ef1cf
- Child:
- 9:4870f0e789f8
--- a/main.cpp Fri Sep 30 09:16:26 2016 +0000
+++ b/main.cpp Fri Sep 30 09:56:19 2016 +0000
@@ -34,8 +34,9 @@
motor1 = 1;
pwm_motor1 = 1;
wait (0.05);
+ 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 +44,9 @@
motor2 = 1;
pwm_motor2 = 1;
wait (0.05);
+ pwm_motor2 = 0;
}
- pwm_motor2 = 0;
+
}
else if (c=='d') // als d ingedrukt wordt gebeurd het volgende
{
@@ -55,9 +57,9 @@
motor1 = 0;
pwm_motor1 = 1;
wait (0.05);
-
+ 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"
@@ -65,8 +67,9 @@
motor2 = 0;
pwm_motor2 = 1;
wait (0.05);
+ pwm_motor2=0;
}
- pwm_motor2=0;
+
}
}