Quadrat fahren

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
simonmacher
Date:
Tue May 02 10:50:15 2017 +0000
Commit message:
Bertl17 Lektion 11;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 7ec47c516da5 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue May 02 10:50:15 2017 +0000
@@ -0,0 +1,43 @@
+#include "mbed.h"
+
+// ************ DEKLARATIONEN **************
+DigitalOut Von (P2_13);           // Motor Spannung ab BERTL15 nötig !
+DigitalOut MotorL_EN(P1_19);      // Enable        OB DIE LINKS ODER RECHTS IST NOCH NICHT KLAR !    
+DigitalOut MotorL_FORWARD(P2_14); // Forwerts  
+DigitalOut MotorL_REVERSE(P2_15); // Rückwerts  
+
+DigitalOut MotorR_EN(P2_19);      //Die Leitung führt zum Pin PO_21 am Prozessor
+DigitalOut MotorR_FORWARD(P2_21); //Die Leitung führt zum Pin P1_3 am Prozessor
+DigitalOut MotorR_REVERSE(P2_20);
+
+// *************  Hauptprogramm ************
+int main() {                     // Start Hauptprogramm
+    Von=1;                       // Motor Spannung EIN
+    MotorR_EN=MotorL_EN=1;       // Beide Motoren ENABLE
+    
+    while(1)
+     {  
+        MotorR_FORWARD = 1;     
+        MotorL_FORWARD = 1;   
+        wait (1.0);
+        MotorR_FORWARD = 0;
+        MotorR_FORWARD = 1;
+        wait(1.0);
+        MotorR_FORWARD = 1;     
+        MotorL_FORWARD = 1;     
+        wait (1.0);
+        MotorR_FORWARD = 0;
+        MotorR_FORWARD = 1;
+        MotorR_FORWARD = 1;     
+        MotorL_FORWARD = 1;   
+        wait (1.0);
+        MotorR_FORWARD = 0;
+        MotorR_FORWARD = 1;
+        wait(1.0);
+        MotorR_FORWARD = 1;     
+        MotorL_FORWARD = 1;     
+        wait (1.0);
+        MotorR_FORWARD = 0;
+        MotorR_FORWARD = 1;
+      }
+}
\ No newline at end of file
diff -r 000000000000 -r 7ec47c516da5 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue May 02 10:50:15 2017 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/mbed_official/code/mbed/builds/794e51388b66
\ No newline at end of file