Bertl Robot with fiunctions

Dependencies:   mbed HCSR

Revision:
7:cb6947e1f1d3
Parent:
6:be710baf53ec
Child:
9:8e3392380915
diff -r be710baf53ec -r cb6947e1f1d3 config.h
--- a/config.h	Thu Jan 22 13:44:59 2015 +0000
+++ b/config.h	Thu Feb 05 12:37:47 2015 +0000
@@ -1,17 +1,17 @@
 /***********************************
-name:   config.h    v0.2
+name:   config.h    v0.4
 author: PE HTL BULME
 email:  pe@bulme.at
 description:
     Constants and wiring for ur_Bertl
-   
+    HC-SR04 ultrasonic sensor added
       
 ***********************************/
 #ifndef _FOO_H
 #define _FOO_H
 
 #include "mbed.h"
-
+#include "hcsr04.h"
 
 #define DEBUG 0
 
@@ -47,17 +47,18 @@
 DigitalOut LED_D13(P1_11);   
 
 DigitalOut MotorL_EN(p34);  // wiring motor left
-DigitalOut MotorL_FORWARD(P1_1);
+DigitalOut MotorL_FORWARD(P1_1);    // changed for Bertl 307
 DigitalOut MotorL_REVERSE(P1_0);
 
 DigitalOut MotorR_EN(p36);  // wiring motor right
-DigitalOut MotorR_FORWARD(P1_4);
-DigitalOut MotorR_REVERSE(P1_3);
+DigitalOut MotorR_FORWARD(P1_3);    
+DigitalOut MotorR_REVERSE(P1_4);
 
 I2C i2c(p28,p27);   
 BusIn linesensor(p18, p16, p19, p17);  
 DigitalIn SensorL(P1_12);    // motor sensor left
 DigitalIn SensorR(P1_13);    // motor sensor right
+HCSR04  usensor(p21,p22);    // HC-SR04 ultrasonic sensor
 
 #if defined(DEBUG) && DEBUG > 0
  #define DEBUG_PRINT(fmt, args...) fprintf(stderr, "DEBUG: %s:%d:%s(): " fmt, \