Leds work simultanously. Version 3.1
Dependents: bertl_led bertl_led bertl_led bertl_led ... more
Fork of Bertl by
config.h
00001 /*! \file config.h 00002 \brief A Documented file. 00003 * name: config.h Version: 3.2 \n 00004 * author: PE HTL BULME \n 00005 * email: pe@bulme.at \n 00006 * description: 00007 * Wiring for ur_Bertl The Robot 00008 */ 00009 00010 #include "mbed.h" 00011 #include "hcsr04.h" 00012 #include "const.h" 00013 00014 #ifndef CONFIG_H 00015 #define CONFIG_H 00016 /*! \def DEBUG 00017 \brief Turns debugging infos off (0) and on (3) which are send to serial pc.uart */ 00018 #define DEBUG 0 00019 //#define FRONTBUTTON /**< Error shutoff if Bertl moves against a wall*/ 00020 #define HCSR /**< if ultrsonic is installed*/ 00021 #define MOTORENC P1_13 /**< P1_12: left encoder P1_13: right encoder (motor) */ 00022 00023 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 */ 00024 DigitalOut LED_D10(P1_8); /**< wiring first LED_D10 */ 00025 DigitalOut LED_D11(P1_9); /**< wiring second LED_D11 */ 00026 DigitalOut LED_D12(P1_10); /**< wiring thired LED_D12 */ 00027 DigitalOut LED_D13(P1_11); /**< wiring fourth LED_D13 */ 00028 00029 DigitalOut LED_blue(P1_28); /**< all blue LEDs are on Port 1_28 */ 00030 00031 DigitalOut RGB_blue(P1_24); /**< RGB blue component of the color uP -> Port 1_24 */ 00032 DigitalOut RGB_red(P1_23); /**< RGB red component of the color uP -> Port 1_23 */ 00033 DigitalOut RGB_green(P1_25); /**< RGB green component of the color uP -> Port 1_25 */ 00034 00035 //------------------ CHANGE ONLY IF NESSESARY ------------------------------------- 00036 00037 DigitalOut MotorL_EN(p34); // wiring motor left 00038 DigitalOut MotorL_FORWARD(P1_1); // change to P1_0 for Bertl 2015 00039 DigitalOut MotorL_REVERSE(P1_0); // change to P1_1 for Bertl 2015 00040 00041 DigitalOut MotorR_EN(p36); // wiring motor right 00042 DigitalOut MotorR_FORWARD(P1_3); // change to P1_4 for Bertl 2015 00043 DigitalOut MotorR_REVERSE(P1_4); // change to P1_3 for Bertl 2015 00044 00045 I2C i2c(p28,p27); 00046 // InterruptIn PushButton(P0_8); // Interrupt I2C Tasten 00047 BusIn linesensor(p18, p16, p19, p17); 00048 BusIn linesensor5(p18, p16, p20, p19, p17); /**< Bertl15 additonal Sensor in the middle */ 00049 DigitalIn SensorL(P1_12); /**< motor sensor left on Port P1_12 */ 00050 DigitalIn SensorR(P1_13); /**< motor sensor right on Port P1_13 */ 00051 HCSR04 usensor(p21,p22); // HC-SR04 ultrasonic sensor 00052 PwmOut mg1(P1_15); // PWM out motor left 00053 PwmOut mg2(P0_21); // PWM out motor right 00054 00055 Serial pc(USBTX, USBRX); // tx, rx 00056 00057 // Bertl 2015 00058 DigitalOut MotorSpg (p30); 00059 DigitalOut IncrementalgeberSpg (P1_7); 00060 DigitalOut LinienSensorSpg (P1_6); 00061 00062 #if defined(DEBUG) && DEBUG > 0 00063 #define DEBUG_PRINT(fmt, args...) fprintf(stderr, "DEBUG: %s:%d:%s(): " fmt, \ 00064 __FILE__, __LINE__, __func__, ##args) 00065 #else 00066 #define DEBUG_PRINT(fmt, args...) /* Don't do anything in release builds */ 00067 #endif 00068 00069 #endif
Generated on Tue Jul 12 2022 21:10:15 by 1.7.2