Bertl Taster Test

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
SebiStr99
Date:
Thu Apr 16 11:48:20 2015 +0000
Commit message:
Tastertest 1

Changed in this revision

Bertl_Sensoren.cpp Show annotated file Show diff for this revision Revisions of this file
Bertl_Sensoren.h 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
ur_Bertl.lib Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r ffde9f956622 Bertl_Sensoren.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Bertl_Sensoren.cpp	Thu Apr 16 11:48:20 2015 +0000
@@ -0,0 +1,40 @@
+#include "mbed.h"
+#include "ur_Bertl.h"
+#include "Bertl_Sensoren.h"
+
+void de_Bertl :: Bewege()   // Definieren
+{
+    Move();    
+}
+
+void de_Bertl :: TurnLedOnAll()
+{
+    TurnLedOn(0xff);
+}
+
+void de_Bertl :: TurnLedOffAll()
+{
+    TurnLedOff(0xff);
+}
+
+void de_Bertl :: LedBlinkLeft()
+{
+    for(int i = 0; i < 4; i++)
+    {
+        TurnLedOn(LED_FL2 | LED_BL1);
+        wait_ms(150);
+        TurnLedOff(0xff);
+        wait_ms(150);
+    }
+}
+
+void de_Bertl :: BlinkLed(int led)
+{
+    for(int i = 0; i < 4; i++)
+    {
+        TurnLedOn(led);
+        wait_ms(150);
+        TurnLedOff(0xff);
+    }
+}
+
diff -r 000000000000 -r ffde9f956622 Bertl_Sensoren.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Bertl_Sensoren.h	Thu Apr 16 11:48:20 2015 +0000
@@ -0,0 +1,17 @@
+#include "mbed.h"
+#include "ur_Bertl.h"
+#include "const.h"
+
+#ifndef DE_BERTL_H
+// #define DE_BERTL_H
+
+class de_Bertl : public ur_Bertl
+{
+public:
+    void Bewege();          // nur Deklaration - Prototyping
+    void TurnLedOnAll();
+    void TurnLedOffAll();
+    void LedBlinkLeft();
+    void BlinkLed(int led);
+};
+#endif
\ No newline at end of file
diff -r 000000000000 -r ffde9f956622 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Apr 16 11:48:20 2015 +0000
@@ -0,0 +1,67 @@
+#include "mbed.h"
+#include "ur_Bertl.h"
+#include "Bertl_Sensoren.h"
+
+// In eigene Datein: Klasse-/Methodendeklaration in de_Bertl.h
+//                      Definition in de_BErtl.cpp
+
+int main()
+{
+    de_Bertl karel;
+    
+    int i = 0;
+    karel.TurnLedOffAll();
+    
+    do
+    {
+        if(karel.IsButtonPressed(BTN_FLL))
+        {
+            karel.BlinkLed(0x02);
+            i++;
+        }
+    
+        if(karel.IsButtonPressed(BTN_FL))
+        {
+            karel.BlinkLed(0x01);
+            i++;
+        }
+        
+        if(karel.IsButtonPressed(BTN_FM))
+        {
+            karel.BlinkLed(0x05);
+            i++;
+        }
+        
+        if(karel.IsButtonPressed(BTN_FR))
+        {
+            karel.BlinkLed(0x04);
+            i++;
+        }
+        
+        if(karel.IsButtonPressed(BTN_FRR))
+        {
+            karel.BlinkLed(0x08);
+            i++;
+        }
+        
+        if(karel.IsButtonPressed(BTN_BL))
+        {
+            karel.BlinkLed(0x30);
+            i++;
+        }
+        
+        if(karel.IsButtonPressed(BTN_BM))
+        {
+            karel.BlinkLed(0xf0);
+            i++;
+        }
+        
+        if(karel.IsButtonPressed(BTN_BR))
+        {
+            karel.BlinkLed(0xc0);
+            i++;
+        }
+    }while(i < 4);
+    
+    karel.ShutOff();    
+}
\ No newline at end of file
diff -r 000000000000 -r ffde9f956622 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Apr 16 11:48:20 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9ad691361fac
\ No newline at end of file
diff -r 000000000000 -r ffde9f956622 ur_Bertl.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ur_Bertl.lib	Thu Apr 16 11:48:20 2015 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/teams/BERTL_CHEL_18/code/ur_Bertl/#6b667e2cb800