Schulaufgabe 21.12.2015

Dependencies:   HCSR

Fork of Bertl by Franz Pucher

Revision:
1:fafbac0ba96d
Parent:
0:66e9a0afcbd6
Child:
2:1cd559ff516b
--- a/ur_Bertl.cpp	Thu Feb 26 10:12:06 2015 +0000
+++ b/ur_Bertl.cpp	Thu Mar 19 19:12:33 2015 +0000
@@ -140,6 +140,13 @@
 {
     char cmd[3];
 
+    if(led == 0xBB) {
+        LED_blue=0;
+        return;
+    } else if (led == 0xFF) {
+        RGBLed(1,1,1);
+        LED_blue=0;
+    }
     cmd[0] = 0x02;
     cmd[1] = ~led;
     i2c.write(addr, cmd, 2);
@@ -149,7 +156,13 @@
 void ur_Bertl::TurnLedOff(int16_t led)
 {
     char cmd[3];
-
+    if(led == 0xBB) {
+        LED_blue=1;
+        return;
+    } else if (led == 0xFF) {
+        RGBLed(0,0,0);      //don't work?
+        LED_blue=1;
+    }
     cmd[0] = 0x02;
     cmd[1] = led;
     i2c.write(addr, cmd, 2);
@@ -217,9 +230,10 @@
 }
 
 //----------------------------------------------------------------------
-/*
+
 bool ur_Bertl::FrontIsClear()
 {
+#ifdef HCSR
     int dist = 0;
     usensor.start();
     wait_ms(10);
@@ -228,8 +242,7 @@
         return false;
     else
         return true;
-    DEBUG_PRINT("Distance: %d", dist);
-
+#else
 // if there is no ultra sonic sensor use this - with front buttons
     char cmd[3];            // array for I2C
     int16_t btns;
@@ -249,9 +262,10 @@
         wert = true;
     DEBUG_PRINT("WERT: %d", wert);
     return wert;
+#endif
 }
 
-
+/*
 bool ur_Bertl::NextToABeeper()
 {
     if (BottomIsBlack())