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:
11:155ce3832f01
Parent:
10:207a1e646191
Child:
12:cedc088eaf05
--- a/const.h	Fri Apr 24 07:46:58 2015 +0000
+++ b/const.h	Fri Apr 24 09:16:40 2015 +0000
@@ -11,7 +11,7 @@
 #define CONST_H
 #define TIME
 const int MOVE=500;
-const int TURN=500;
+const int TURN=300; 
 
 /*! \var int ULTRASONIC_DISTANCE
 \brief Bertl Ultrasonic Distance Sensor from 1 to n; 5 is ok for nearly 5 cm.
@@ -28,7 +28,7 @@
 /*! \var int ANGLE
 \brief 12 is nearly 90 degree turn left.
 \warning maybe the number has to be adjusted */
-const int ANGLE = 12;       /*  nearly 90 degree turn left */
+const int ANGLE = 4;      /*  nearly 90 degree turn left */
 
 const int BTN_FLL = 0x80;   //  button front left outer 
 const int BTN_FL  = 0x04;   // button front left