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
Diff: TechMoveDXC.cpp
- Revision:
- 2:a12d19da681a
- Parent:
- 1:685f9717028d
- Child:
- 3:381aaa338447
--- a/TechMoveDXC.cpp Fri Apr 17 19:25:08 2015 +0000
+++ b/TechMoveDXC.cpp Fri Apr 17 20:52:22 2015 +0000
@@ -18,8 +18,42 @@
PwmOut ML (dp18); //PWM-signaal voor de linker motor.
PwmOut MR (dp2); //PWM-signaal voor de rechter motor.
-
int main()
{
-
+ int n = 0; //Variabel voor de straight line stand.
+ MLL = false;
+ MLR = false;
+ MRL = false;
+ MRR = false;
+ LED = false;
+ MR = 0;
+ ML = 0;
+ while (K1) //Sumo stand.
+ {
+ n = 0;
+ }
+ while (K2) //Straight line stand.
+ {
+ LED = !LED;
+ n += 1;
+ if (n == 6)
+ {
+ LED = true;
+ MLR = true;
+ MRR = true;
+ MR = 1.0;
+ ML = 1.0;
+ wait (5.0); //Tijd van het rijden.
+ MLR = false;
+ MRR = false;
+ MR = 0;
+ ML = 0;
+ }
+ wait (0.5);
+
+ }
+ while (K3) //Service stand.
+ {
+ n = 0;
+ }
}
\ No newline at end of file