B17 fährt vor - stop -vor (DigitalOut & wait)

Dependencies:   mbed

Fork of B17_Lektion03b by BULME_BERTL17

Files at this revision

API Documentation at this revision

Comitter:
Enenkel
Date:
Sat May 13 10:13:07 2017 +0000
Parent:
2:416e90645a22
Commit message:
B17_Lektion03b

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
--- a/main.cpp	Fri Jun 19 06:52:24 2015 +0000
+++ b/main.cpp	Sat May 13 10:13:07 2017 +0000
@@ -1,43 +1,44 @@
-/***********************************
-name:   BERTL_2015_MOTOR_TEST
-author: Gottfried Enenkel   HTL BULME
-email:  ene@bulme.at
-description:
-    Der BERTL fährt 1 sec lang  VORWÄRTS! 
-    Danach steht er für 1 sec
-    
-    Wenn der Motor richtig eingebaut ist, 
-    steht über dem Linken Anschluß ein PLUS
-    Wenn sich der BERTL dreht, ist ein Motor verkehrt eingebaut. 
-    
-***********************************/
+/***************************************************************************
+Name:   B17_Lektion03b                                 fahre 1/2sec vorwärts
+Author: Gottfried Enenkel   HTL BULME
+Email:  ene@bulme.at
+Aufgabe:
+    Ändere die Software so, dass
+    der BERTL 0,5 sec vor
+    und dann 0,5 sec wartet
+***************************************************************************/
 #include "mbed.h"
 
 // ************ DEKLARATIONEN **************
-DigitalOut Von (P1_2);           // Motor Spannung ab BERTL15 nötig !
-DigitalOut MotorL_EN(P1_15);     // Enable    
-DigitalOut MotorL_FORWARD(P1_1); // Forwerts  
-DigitalOut MotorL_REVERSE(P1_0); // Rückwerts  
+DigitalOut Von (P2_13);          // 10 V Versorgung einschalten !
 
-DigitalOut MotorR_EN(P0_21);     //Die Leitung führt zum Pin PO_21 am Prozessor
-DigitalOut MotorR_FORWARD(P1_3); //Die Leitung führt zum Pin P1_3 am Prozessor
-DigitalOut MotorR_REVERSE(P1_4);
+// Motor MG1
+DigitalOut MotorL_EN(P1_19);     // Enable
+DigitalOut MotorL_FORWARD(P2_14);// Vorwerts
+DigitalOut MotorL_REVERSE(P2_15);// Rückwerts
+// MOTOR MG2
+DigitalOut MotorR_EN(P2_19);      // Enable
+DigitalOut MotorR_FORWARD(P2_20); // Vorwerts
+DigitalOut MotorR_REVERSE(P1_4);  // Rückwerts 
 
 // *************  Hauptprogramm ************
-int main() {                     // Start Hauptprogramm
-    Von=1;                       // Motor Spannung EIN
+int main()                       // Start Hauptprogramm
+{
+    Von=1;                       // Motor Versorgunga 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 
+    
+    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  
+        wait (1.0);              // warte 1 Sekunde
+        
         MotorR_FORWARD = 0;      // RECHTER Motor STOP
-        MotorL_FORWARD = 0;      // LINKER Motoren STOP  
-        wait (1.0);              // warte 1 Sekunde 
-    }                            // Springe zum Anfang der Schleife 
+        MotorL_FORWARD = 0;      // LINKER Motoren STOP
+        wait (1.0);              // warte 1 Sekunde
+    }                            // Springe zum Anfang der Schleife
 }                                // Ende des Hauptprogrammes
 
-// **************     ENDE     *************
+// ****************************     ENDE     *********************************
 
 
 
--- a/mbed.bld	Fri Jun 19 06:52:24 2015 +0000
+++ b/mbed.bld	Sat May 13 10:13:07 2017 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/4fc01daae5a5
\ No newline at end of file
+https://mbed.org/users/mbed_official/code/mbed/builds/4eea097334d6
\ No newline at end of file