Leds work simultanously. Version 3.1
Dependents: bertl_led bertl_led bertl_led bertl_led ... more
Fork of Bertl by
BULME HTL Graz-Gösting
FSST - Hardwarenahe Programmierung
Created by Prof.Dr. Franz Pucher
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); } } }
Diff: config.h
- Revision:
- 18:e9bb4513ae3a
- Parent:
- 15:43d6a7e6e64a
diff -r 308802267a62 -r e9bb4513ae3a config.h --- a/config.h Thu Nov 12 19:05:56 2015 +0000 +++ b/config.h Fri Feb 19 15:28:42 2016 +0000 @@ -1,6 +1,6 @@ /*! \file config.h \brief A Documented file. -* name: config.h Version: 3.0 \n +* name: config.h Version: 3.2 \n * author: PE HTL BULME \n * email: pe@bulme.at \n * description: @@ -18,7 +18,7 @@ #define DEBUG 0 //#define FRONTBUTTON /**< Error shutoff if Bertl moves against a wall*/ #define HCSR /**< if ultrsonic is installed*/ -#define MOTORENC P1_13 /**< P1_12: left encoder P1_13: rigth encoder (motor) */ +#define MOTORENC P1_13 /**< P1_12: left encoder P1_13: right 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 */ @@ -43,7 +43,9 @@ DigitalOut MotorR_REVERSE(P1_4); // change to P1_3 for Bertl 2015 I2C i2c(p28,p27); +// InterruptIn PushButton(P0_8); // Interrupt I2C Tasten BusIn linesensor(p18, p16, p19, p17); +BusIn linesensor5(p18, p16, p20, p19, p17); /**< Bertl15 additonal Sensor in the middle */ DigitalIn SensorL(P1_12); /**< motor sensor left on Port P1_12 */ DigitalIn SensorR(P1_13); /**< motor sensor right on Port P1_13 */ HCSR04 usensor(p21,p22); // HC-SR04 ultrasonic sensor