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/config.h	Sun Apr 26 20:04:47 2015 +0000
+++ b/config.h	Mon Apr 27 13:13:45 2015 +0000
@@ -1,6 +1,6 @@
 /*! \file config.h
 \brief A Documented file.
-* name:   config.h    Version: 1.1 \n
+* name:   config.h    Version: 3.0 \n
 * author: PE HTL BULME \n
 * email:  pe@bulme.at \n
 * description:
@@ -16,8 +16,9 @@
 /*! \def DEBUG
 \brief Turns debugging infos off (0) and on (3) which are send to serial pc.uart */
 #define DEBUG 0
-//#define FRONTBUTTON     /**< Error shutoff if Bertl moves against a wall*/
-#define HCSR            /**< if ultrsonic is installed*/
+//#define FRONTBUTTON       /**< Error shutoff if Bertl moves against a wall*/
+#define HCSR                /**< if ultrsonic is installed*/
+#define MOTORENC P1_12        /**< P1_12: left encoder P1_13: rigth encoder (motor) */
 
 BusOut NibbleLEDs(P1_8, P1_9, P1_10, P1_11);   /**< 4 yellow LEDs as a bus defined; use it i.e.: karel.NibbleLeds(karel.GetLineValues()); to show line sensor values */
 DigitalOut LED_D10(P1_8);    /**<  wiring first LED_D10 */