1sec vor 1sek retour

Dependencies:   mbed

Revision:
0:75cd38798022
--- /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);             
+    }                            
+}
+