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:
18:e9bb4513ae3a
Parent:
17:308802267a62
--- a/ur_Bertl.h	Thu Nov 12 19:05:56 2015 +0000
+++ b/ur_Bertl.h	Fri Feb 19 15:28:42 2016 +0000
@@ -1,12 +1,12 @@
 /***********************************
-name:   ur_Bertl.h      Version: 3.0
+name:   ur_Bertl.h      Version: 3.2
         class Bertl included
 author: PE HTL BULME
 email:  pe@bulme.at
 WIKI:   https://developer.mbed.org/teams/BERTL_CHEL_18/code/ur_Bertl/
 description:
         Definition portion of the class ur_Bertl The Robot
-        Step wise turns on left and rigth
+        Step wise turns on left and Right
         int ReturnButtonPressed() added which returns the int value of button pressed 
 ***********************************/
 #include "mbed.h"
@@ -224,7 +224,7 @@
             karel.TurnLeftStep(20);
             break;
         case 0x0E: case 0x0A: case 0x08:
-            karel.TurnRigthStep(20);
+            karel.TurnRightStep(20);
             break;
         default:
             karel.Move(20);
@@ -243,10 +243,11 @@
     //Bertl();                 /**< default constructor; you have to define constants in config.h such as SPEED, DISTANCE or ANGLE*/
     int Move(int move = MOVE);                /**< Robot moves one turn as much as the constant DISTANCE; if one of the buttons fire --> Error()*/      
     int MoveBackwards(int move = MOVE);       /**< Robot moves as much back as the constant DISTANCE; if one of the buttons fire --> Error()*/
-    void TurnRigth();           /**< Robot turns rigth as much as the constant ANGLE*/ 
+    void TurnRight();           /**< Robot turns Right as much as the constant ANGLE*/ 
     void TurnLeftStep(int step=STEPTIME);   /**< Robot turns left for a short time defined in STEPTIME */
-    void TurnRigthStep(int step=STEPTIME);  /**< Robot turns rigth for a short time defined in STEPTIME */
+    void TurnRightStep(int step=STEPTIME);  /**< Robot turns Right for a short time defined in STEPTIME */
     uint8_t GetLineValues();    /**< in the lower 4 bit are the values of the line sensor */
+    uint8_t GetLineValues5();    /**< Bertl15: lower 5 bit are the values of the line sensor */
     void RGBLed(bool red, bool green, bool blue); /**<RGB Led with red, green and blue component of the Color */
 };
 #endif
\ No newline at end of file