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:
13:3ce84646fd74
Parent:
12:cedc088eaf05
Child:
15:43d6a7e6e64a
--- a/ur_Bertl.h	Sun Apr 26 20:04:47 2015 +0000
+++ b/ur_Bertl.h	Mon Apr 27 13:13:45 2015 +0000
@@ -1,5 +1,6 @@
 /***********************************
-name:   ur_Bertl.h      Version: 2.2
+name:   ur_Bertl.h      Version: 3.0
+        class Bertl included
 author: PE HTL BULME
 email:  pe@bulme.at
 WIKI:   https://developer.mbed.org/teams/BERTL_CHEL_18/code/ur_Bertl/
@@ -18,7 +19,8 @@
 #define RIGHTSENSOR P1_13
 /********************************************//**
  name:   ur_Bertl.h \n
- version: 2.2 \n
+ version: 3.0 \n
+   class Bertl included \n
  author:PE HTL BULME \n
  email: pe@bulme.at \n
  WIKI:  https://developer.mbed.org/teams/BERTL_CHEL_18/code/ur_Bertl/wiki/Homepage \n
@@ -167,7 +169,7 @@
 };
 /********************************************//**
  name:   Bertl.h \n
- version: 1.0 \n
+ version: 3.0 \n
  author:PE HTL BULME \n
  email: pe@bulme.at \n
  WIKI:  https://developer.mbed.org/teams/BERTL_CHEL_18/code/ur_Bertl/wiki/Homepage \n
@@ -236,10 +238,12 @@
 protected:
 public:
     //Bertl();                 /**< default constructor; you have to define constants in config.h such as SPEED, DISTANCE or ANGLE*/
-    void MoveBackwards(int move = MOVE);       /**< Robot moves as much back as the constant DISTANCE; if one of the buttons fire --> Error()*/
+    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 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 */
     uint8_t GetLineValues();    /**< in the lower 4 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