1sec vor 1sek retour

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
simonmacher
Date:
Tue May 02 08:08:50 2017 +0000
Commit message:
Bertl17_Lektion10

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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue May 02 08:08:50 2017 +0000
@@ -0,0 +1,32 @@
+#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) {                   // Anfang der Schleife (ohne Abbruch)   
+        MotorR_FORWARD = 1;      // RECHTER Motor vorwärts EIN 
+        MotorL_FORWARD = 1;      // LINKER Motoren vorwärts EIN
+        wait (1.0);              // warte 1 Sekunde  
+        MotorR_FORWARD = 0;      // RECHTER Motor STOP
+        MotorL_FORWARD = 0;      // LINKER Motoren STOP  
+        wait (1.0);             
+        MotorR_REVERSE = 1;      
+        MotorL_REVERSE = 1;      
+        wait (1.0);              
+        MotorR_REVERSE = 0;     
+        MotorL_REVERSE = 0;     
+        wait (1.0);             
+    }                            
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue May 02 08:08:50 2017 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/mbed_official/code/mbed/builds/794e51388b66
\ No newline at end of file