Bertl

Dependencies:   Bertl mbed

Files at this revision

API Documentation at this revision

Comitter:
Michi_Jocham
Date:
Mon Dec 21 14:31:11 2015 +0000
Commit message:
bertl

Changed in this revision

Bertl.lib Show annotated file Show diff for this revision Revisions of this file
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 9f717595fa8b Bertl.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Bertl.lib	Mon Dec 21 14:31:11 2015 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/Michi_Jocham/code/Bertl/#2a4fa405eec6
diff -r 000000000000 -r 9f717595fa8b main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Dec 21 14:31:11 2015 +0000
@@ -0,0 +1,97 @@
+#include "mbed.h"
+#include "const.h"
+#include "Robot.h"
+#include "ur_Bertl.h"
+Robot bertl;
+bool Ultraschallsensor ()
+{
+    if(bertl.FrontIsClear())
+    {
+        return true;
+    }
+    else 
+    {
+        return false;
+    }
+        
+}
+void Alarmblinkanlage ()
+{
+    bertl.TurnLedOn(LED_ALL_FRONT);
+    bertl.TurnLedOn(LED_ALL_BACK);
+    wait(0.1);
+    bertl.TurnLedOff(LED_ALL_FRONT);
+    bertl.TurnLedOff(LED_ALL_BACK);
+            
+}
+void FrontscheinwerferAn ()
+{
+    bertl.TurnLedOn(LED_FL1); 
+    bertl.TurnLedOn(LED_FR1);    
+}
+void FrontscheinwerferAus ()
+{
+    bertl.TurnLedOff(LED_FL1); 
+    bertl.TurnLedOff(LED_FR1); 
+}
+
+
+
+void BlinkenLinks()
+{ 
+ int a=0;
+ int b=1;
+    while(a<b)
+    {
+        bertl.TurnLedOn(LED_BL1);
+        bertl.TurnLedOn(LED_FL2);
+        wait(0.1);
+        bertl.TurnLedOff(LED_BL1);
+        bertl.TurnLedOff(LED_FL2);
+        a++;
+    }
+}
+
+
+void BlinkenRechts()
+{
+     int a=0;
+     int b=1;
+    while(a<b)
+    {
+        bertl.TurnLedOn(LED_FR2);
+        bertl.TurnLedOn(LED_BR2);
+        wait(0.1);
+        bertl.TurnLedOff(LED_FR2);
+        bertl.TurnLedOff(LED_BR2);
+        a++;
+    }
+}
+
+
+
+int main() 
+{
+   
+   
+    while(1)
+    {
+        
+    
+        if(Ultraschallsensor()) 
+        {
+            Alarmblinkanlage();
+            bertl.MoveBackwards();
+            BlinkenLinks();
+            bertl.TurnLeft();
+            bertl.Move();
+            BlinkenRechts();
+            bertl.TurnRigth();
+        }
+        else
+        {
+            bertl.Move();
+        }
+        
+    }
+}
diff -r 000000000000 -r 9f717595fa8b mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Dec 21 14:31:11 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/165afa46840b
\ No newline at end of file