Bertl

Dependencies:   HCSR mbed

Committer:
Alexander400
Date:
Thu Apr 23 12:04:34 2015 +0000
Revision:
0:ae8f51bac163
Bertl

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Alexander400 0:ae8f51bac163 1 /*! \file config.h
Alexander400 0:ae8f51bac163 2 \brief A Documented file.
Alexander400 0:ae8f51bac163 3 * name: config.h Version: 1.1
Alexander400 0:ae8f51bac163 4 * author: PE HTL BULME
Alexander400 0:ae8f51bac163 5 * email: pe@bulme.at
Alexander400 0:ae8f51bac163 6 * description:
Alexander400 0:ae8f51bac163 7 * Wiring for ur_Bertl The Robot
Alexander400 0:ae8f51bac163 8 */
Alexander400 0:ae8f51bac163 9
Alexander400 0:ae8f51bac163 10 #include "mbed.h"
Alexander400 0:ae8f51bac163 11 #include "hcsr04.h"
Alexander400 0:ae8f51bac163 12 #include "const.h"
Alexander400 0:ae8f51bac163 13
Alexander400 0:ae8f51bac163 14 #ifndef CONFIG_H
Alexander400 0:ae8f51bac163 15 #define CONFIG_H
Alexander400 0:ae8f51bac163 16 /*! \def DEBUG
Alexander400 0:ae8f51bac163 17 \brief Turns debugging infos off (0) and on (3) which are send to serial pc.uart */
Alexander400 0:ae8f51bac163 18 #define DEBUG 0
Alexander400 0:ae8f51bac163 19 //#define FRONTBUTTON
Alexander400 0:ae8f51bac163 20
Alexander400 0:ae8f51bac163 21 BusOut NibbleLEDs(P1_8, P1_9, P1_10, P1_11); /**< 4 yellow LEDs as a bus defined */
Alexander400 0:ae8f51bac163 22 DigitalOut LED_D10(P1_8); /**< wiring first LED_D10 */
Alexander400 0:ae8f51bac163 23 DigitalOut LED_D11(P1_9); /**< wiring second LED_D11 */
Alexander400 0:ae8f51bac163 24 DigitalOut LED_D12(P1_10); /**< wiring thired LED_D12 */
Alexander400 0:ae8f51bac163 25 DigitalOut LED_D13(P1_11); /**< wiring fourth LED_D13 */
Alexander400 0:ae8f51bac163 26
Alexander400 0:ae8f51bac163 27 DigitalOut LED_blue(P1_28); /**< all blue LEDs are on Port 1_28 */
Alexander400 0:ae8f51bac163 28
Alexander400 0:ae8f51bac163 29 DigitalOut RGB_blue(P1_24); /**< RGB blue component of the color uP -> Port 1_24 */
Alexander400 0:ae8f51bac163 30 DigitalOut RGB_red(P1_23); /**< RGB red component of the color uP -> Port 1_23 */
Alexander400 0:ae8f51bac163 31 DigitalOut RGB_green(P1_25); /**< RGB green component of the color uP -> Port 1_25 */
Alexander400 0:ae8f51bac163 32
Alexander400 0:ae8f51bac163 33 //------------------ CHANGE ONLY IF NESSESARY -------------------------------------
Alexander400 0:ae8f51bac163 34
Alexander400 0:ae8f51bac163 35 DigitalOut MotorL_EN(p34); // wiring motor left
Alexander400 0:ae8f51bac163 36 DigitalOut MotorL_FORWARD(P1_1);
Alexander400 0:ae8f51bac163 37 DigitalOut MotorL_REVERSE(P1_0);
Alexander400 0:ae8f51bac163 38
Alexander400 0:ae8f51bac163 39 DigitalOut MotorR_EN(p36); // wiring motor right
Alexander400 0:ae8f51bac163 40 DigitalOut MotorR_FORWARD(P1_3);
Alexander400 0:ae8f51bac163 41 DigitalOut MotorR_REVERSE(P1_4);
Alexander400 0:ae8f51bac163 42
Alexander400 0:ae8f51bac163 43 I2C i2c(p28,p27);
Alexander400 0:ae8f51bac163 44 BusIn linesensor(p18, p16, p19, p17);
Alexander400 0:ae8f51bac163 45 DigitalIn SensorL(P1_12); /**< motor sensor left on Port P1_12 */
Alexander400 0:ae8f51bac163 46 DigitalIn SensorR(P1_13); /**< motor sensor right on Port P1_13 */
Alexander400 0:ae8f51bac163 47 HCSR04 usensor(p21,p22); // HC-SR04 ultrasonic sensor
Alexander400 0:ae8f51bac163 48 PwmOut mg1(P1_15); // PWM out motor left
Alexander400 0:ae8f51bac163 49 PwmOut mg2(P0_21); // PWM out motor right
Alexander400 0:ae8f51bac163 50
Alexander400 0:ae8f51bac163 51 Serial pc(USBTX, USBRX); // tx, rx
Alexander400 0:ae8f51bac163 52
Alexander400 0:ae8f51bac163 53 #if defined(DEBUG) && DEBUG > 0
Alexander400 0:ae8f51bac163 54 #define DEBUG_PRINT(fmt, args...) fprintf(stderr, "DEBUG: %s:%d:%s(): " fmt, \
Alexander400 0:ae8f51bac163 55 __FILE__, __LINE__, __func__, ##args)
Alexander400 0:ae8f51bac163 56 #else
Alexander400 0:ae8f51bac163 57 #define DEBUG_PRINT(fmt, args...) /* Don't do anything in release builds */
Alexander400 0:ae8f51bac163 58 #endif
Alexander400 0:ae8f51bac163 59
Alexander400 0:ae8f51bac163 60 #endif