-> Bertl16 Firmware 1.0 -> fährt 2sec gerade aus -> blinkt 2x links -> bremslichter leuchten auf und er bleibt stehen -> dreht nach ca. 90° nach links -> und alles geht wieder von vorne los

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Julien_Blue
Date:
Wed May 18 09:07:03 2016 +0000
Commit message:
Written by Julian Koller.

Changed in this revision

firmware.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/firmware.cpp	Wed May 18 09:07:03 2016 +0000
@@ -0,0 +1,83 @@
+/***********************************
+name:   firware_1.0
+author: Julian Koller
+description:
+ -> fährt 2sec gerade aus
+ -> blinkt 2x links
+ -> bremslichter leuchten auf und er bleibt stehen
+ -> dreht nach ca. 90° nach links
+ -> und alles geht wieder von vorne los    
+***********************************/
+ 
+#include <mbed.h>
+ 
+//Definition der Motoren
+DigitalOut Von (P2_13);
+DigitalOut MotorL_EN(P1_19);
+DigitalOut MotorL_REVERSE(P2_14);
+DigitalOut MotorL_FORWARD(P2_15);
+ 
+DigitalOut MotorR_EN(P2_19);
+DigitalOut MotorR_REVERSE(P2_21);
+DigitalOut MotorR_FORWARD(P2_20);
+ 
+ 
+// Definition der LEDS als AUSGANGE
+DigitalOut LedD1 (P1_10);      
+DigitalOut LedD2 (P1_11);
+DigitalOut LedD4 (P1_12);
+DigitalOut LedD5 (P1_13);
+DigitalOut LedD6 (P1_14);      
+DigitalOut LedD7 (P1_15);
+DigitalOut LedD8 (P1_16);
+DigitalOut LedD9 (P1_17);
+DigitalOut LedD10 (P1_18);     
+DigitalOut LedD11 (P2_16);
+DigitalOut LedD12 (P1_20);
+DigitalOut LedD13 (P1_21);
+DigitalOut BlueLed (P1_5);
+ 
+// Hauptprogramm
+int main()
+{
+    Von = 1;
+    MotorL_EN = MotorR_EN = 1;
+    LedD1 = LedD2 = LedD4 = LedD5 = LedD6 = LedD7 = LedD8 = LedD9 = LedD10 = LedD11 = LedD12 = LedD13 = BlueLed = 1;
+    
+    do
+    {
+        LedD1 = LedD4 = BlueLed = 0;
+        
+        
+        MotorL_FORWARD = MotorR_FORWARD = 1;
+        
+        wait(2);
+        LedD2 = LedD6 = 0;
+        wait(0.5);
+        LedD2 = LedD6 = 1;
+        wait(0.5);
+        LedD2 = LedD6 = 0;
+        wait(0.5);
+        LedD2 = LedD6 = 1;
+        LedD7 = LedD9 = 0;
+        wait(0.25);
+        
+        MotorL_FORWARD = MotorR_FORWARD = 0;
+        
+        wait(0.25);
+        LedD7 = LedD9 = 1;
+        LedD2 = LedD6 = 0;
+        wait(0.5);
+        LedD2 = LedD6 = 1;
+        wait(0.5);
+        LedD2 = LedD6 = 0;
+        wait(0.5);
+        LedD2 = LedD6 = 1;
+        wait(0.5);
+        
+        MotorR_FORWARD = 1;
+        
+        wait(0.25);
+        } while(1);
+}
+   
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed May 18 09:07:03 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/4fc01daae5a5
\ No newline at end of file