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:
1:fafbac0ba96d
Parent:
0:66e9a0afcbd6
Child:
4:76acfddc26fb
--- a/ur_Bertl.h	Thu Feb 26 10:12:06 2015 +0000
+++ b/ur_Bertl.h	Thu Mar 19 19:12:33 2015 +0000
@@ -116,6 +116,7 @@
     void TurnLeft();            /**< Robot turns left as much as the constant ANGLE*/      
     void PutBeeper();           /**< if Robot has any Beepers in his bag he can put one or more Beeper; if not --> Error(()*/  
     void PickBeeper();          /**< if Robot stands on a black item he can pick one or more Beeper (max. 16 --> Error()); if not --> Error()*/   
+    bool FrontIsClear();        /**< returns a boolean value true if front is free; if not false */ 
     void NibbleLeds(int value); /**< methode for the 4 (half byte) yellow LEDs at the back left side */
     void TurnLedOn(int16_t led);/**< turns the specified one or more LEDs ON; description and name in const.h, such as LED_FL1 = 0x01; front LED white */
     void TurnLedOff(int16_t led);/**< turns the specified one or more LEDs OFF; description and name in const.h, such as LED_FL1 = 0x01; front LED white */