Leds work simultanously. Version 3.1

Dependencies:   HCSR

Dependents:   bertl_led bertl_led bertl_led bertl_led ... more

Fork of Bertl by Bertl_Team_PE

BULME HTL Graz-Gösting

FSST - Hardwarenahe Programmierung

Created by Prof.Dr. Franz Pucher

Inhalt

Inhalt

Start mit folgendem Code in main.cpp eines neuen Projektes mbed_blinky:

#include "mbed.h"
#include "const.h"
#include "Robot.h"

Robot bertl;
    
int main()
{
    bertl.NibbleLeds(0x0F);
    wait(1);
    bertl.NibbleLeds(0x00);
    
    while(1)
    {
        if(bertl.IsButtonPressed(BTN_BL))
        {
            bertl.TurnLedOn(LED_BL1);
        }
        if(bertl.IsButtonPressed(BTN_BR))
        {
            bertl.TurnLedOff(LED_BL1);
        }
    }
}
Revision:
6:df6830254e8b
Parent:
5:6b667e2cb800
Child:
7:e7f74f072564
--- a/ur_Bertl.cpp	Fri Apr 10 07:12:07 2015 +0000
+++ b/ur_Bertl.cpp	Fri Apr 10 09:31:54 2015 +0000
@@ -178,7 +178,7 @@
     usensor.start();
     wait_ms(10);
     dist=usensor.get_dist_cm();
-    if(dist < 5)
+    if(dist < ULTRASONIC_DISTANCE)
         return false;
     else
         return true;