Bertl Robot with fiunctions

Dependencies:   mbed HCSR

Committer:
bulmecisco
Date:
Thu Jan 22 13:44:59 2015 +0000
Revision:
6:be710baf53ec
Parent:
5:7b091d085c70
Child:
7:cb6947e1f1d3
MoveMeasure Bug fixed.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bulmecisco 4:a975caedface 1 /***********************************
bulmecisco 6:be710baf53ec 2 name: config.h v0.2
bulmecisco 4:a975caedface 3 author: PE HTL BULME
bulmecisco 4:a975caedface 4 email: pe@bulme.at
bulmecisco 4:a975caedface 5 description:
bulmecisco 6:be710baf53ec 6 Constants and wiring for ur_Bertl
bulmecisco 4:a975caedface 7
bulmecisco 4:a975caedface 8
bulmecisco 4:a975caedface 9 ***********************************/
bulmecisco 5:7b091d085c70 10 #ifndef _FOO_H
bulmecisco 5:7b091d085c70 11 #define _FOO_H
bulmecisco 5:7b091d085c70 12
bulmecisco 4:a975caedface 13 #include "mbed.h"
bulmecisco 4:a975caedface 14
bulmecisco 5:7b091d085c70 15
bulmecisco 4:a975caedface 16 #define DEBUG 0
bulmecisco 4:a975caedface 17
bulmecisco 4:a975caedface 18 const int BTN_FLL = 0x80; // button front left outer
bulmecisco 4:a975caedface 19 const int BTN_FL = 0x04; // button front left
bulmecisco 4:a975caedface 20 const int BTN_FM = 0x01; // button front middle
bulmecisco 4:a975caedface 21 const int BTN_FR = 0x08; // button front right
bulmecisco 4:a975caedface 22 const int BTN_FRR = 0x40; // button front right outer
bulmecisco 4:a975caedface 23 const int BTN_BL = 0x10; // button back left
bulmecisco 4:a975caedface 24 const int BTN_BM = 0x02; // button back middle
bulmecisco 4:a975caedface 25 const int BTN_BR = 0x20; // button back right
bulmecisco 4:a975caedface 26
bulmecisco 4:a975caedface 27 const int LED_FL1 = 0x01; // front LED white
bulmecisco 4:a975caedface 28 const int LED_FL2 = 0x02; // front LED yellow
bulmecisco 4:a975caedface 29 const int LED_FR1 = 0x04; // front LED white
bulmecisco 4:a975caedface 30 const int LED_FR2 = 0x08; // front LED yellow
bulmecisco 4:a975caedface 31 const int LED_ALL_FRONT = 0x0F;
bulmecisco 4:a975caedface 32
bulmecisco 4:a975caedface 33 const int LED_BL1 = 0x20; // yellow LED back left outer
bulmecisco 4:a975caedface 34 const int LED_BL2 = 0x10; // red LED back left inner
bulmecisco 4:a975caedface 35 const int LED_BR1 = 0x80; // yellow LED back right outer
bulmecisco 4:a975caedface 36 const int LED_BR2 = 0x40; // red LED back right inner
bulmecisco 4:a975caedface 37 const int LED_ALL_BACK = 0xF0;
bulmecisco 4:a975caedface 38 const int LED_ALL = 0xFF;
bulmecisco 4:a975caedface 39
bulmecisco 4:a975caedface 40 const int addr = 0x40; // I2C-address PCA9555
bulmecisco 4:a975caedface 41
bulmecisco 4:a975caedface 42 Serial pc(USBTX, USBRX); // tx, rx
bulmecisco 4:a975caedface 43
bulmecisco 4:a975caedface 44 DigitalOut LED_D10(P1_8); // wiring LED D10 to D13
bulmecisco 4:a975caedface 45 DigitalOut LED_D11(P1_9);
bulmecisco 4:a975caedface 46 DigitalOut LED_D12(P1_10);
bulmecisco 4:a975caedface 47 DigitalOut LED_D13(P1_11);
bulmecisco 4:a975caedface 48
bulmecisco 4:a975caedface 49 DigitalOut MotorL_EN(p34); // wiring motor left
bulmecisco 4:a975caedface 50 DigitalOut MotorL_FORWARD(P1_1);
bulmecisco 4:a975caedface 51 DigitalOut MotorL_REVERSE(P1_0);
bulmecisco 4:a975caedface 52
bulmecisco 4:a975caedface 53 DigitalOut MotorR_EN(p36); // wiring motor right
bulmecisco 6:be710baf53ec 54 DigitalOut MotorR_FORWARD(P1_4);
bulmecisco 6:be710baf53ec 55 DigitalOut MotorR_REVERSE(P1_3);
bulmecisco 4:a975caedface 56
bulmecisco 4:a975caedface 57 I2C i2c(p28,p27);
bulmecisco 4:a975caedface 58 BusIn linesensor(p18, p16, p19, p17);
bulmecisco 4:a975caedface 59 DigitalIn SensorL(P1_12); // motor sensor left
bulmecisco 4:a975caedface 60 DigitalIn SensorR(P1_13); // motor sensor right
bulmecisco 4:a975caedface 61
bulmecisco 6:be710baf53ec 62 #if defined(DEBUG) && DEBUG > 0
bulmecisco 6:be710baf53ec 63 #define DEBUG_PRINT(fmt, args...) fprintf(stderr, "DEBUG: %s:%d:%s(): " fmt, \
bulmecisco 6:be710baf53ec 64 __FILE__, __LINE__, __func__, ##args)
bulmecisco 6:be710baf53ec 65 #else
bulmecisco 6:be710baf53ec 66 #define DEBUG_PRINT(fmt, args...) /* Don't do anything in release builds */
bulmecisco 6:be710baf53ec 67 #endif
bulmecisco 6:be710baf53ec 68
bulmecisco 4:a975caedface 69 #endif