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:
4:76acfddc26fb
Parent:
3:01b183fe8b41
Child:
6:df6830254e8b
--- a/const.h	Thu Mar 26 13:06:00 2015 +0000
+++ b/const.h	Tue Apr 07 12:30:39 2015 +0000
@@ -1,8 +1,8 @@
 /*! \file const.h
 \brief A Documented file.
-* name:   const.h    Version: 1.0
-* author: PE HTL BULME
-* email:  pe@bulme.at
+* name:   const.h    Version: 1.0 \n
+* author: PE HTL BULME \n
+* email:  pe@bulme.at \n
 * description:
 *    Constants for ur_Bertl The Robot
 */
@@ -19,7 +19,7 @@
 /*! \var int DISTANCE
 \brief one wheel turn is appr. 24 ticks.
 \warning maybe the number has to be adjusted */
-const int DISTANCE = 24;    /*  one wheel turn is appr. 24 ticks */
+const int DISTANCE = 12;    /*  one wheel turn is appr. 24 ticks */
 /*! \var int ANGLE
 \brief 12 is nearly 90 degree turn left.
 \warning maybe the number has to be adjusted */