seeing i robot - with all the file systems and complete code

Dependencies:   mbed SRF05 Servo CMPS03

Files at this revision

API Documentation at this revision

Comitter:
sowmy87
Date:
Fri Dec 17 22:55:25 2010 +0000
Parent:
0:ee786e500a3c
Commit message:
Sensor 1 edited

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Fri Dec 17 18:27:33 2010 +0000
+++ b/main.cpp	Fri Dec 17 22:55:25 2010 +0000
@@ -10,11 +10,9 @@
 SRF05 srf2(p24, p25);
 Serial pc(USBTX, USBRX);
 Servo myservo(p21);
-VS1002 mp3(p5, p6, p7, p8, "sd",
-        p11, p12, p13, p14, p15,
-        p16, p17, p20);     //p14 in BoB non-functional so replace with p18
+VS1002 mp3(p5, p6, p7, p8, "sd",p11, p12, p13, p14, p15,p16, p17, p20);     //p14 in BoB non-functional so replace with p18
 Serializer robot;
-//CMPS03 compass(p9,p10, CMPS03_DEFAULT_I2C_ADDRESS);
+CMPS03 compass(p9,p10, CMPS03_DEFAULT_I2C_ADDRESS);
 
 
 float motor_turn();
@@ -54,9 +52,9 @@
         pc.printf("\n\rNew code!!!");
         myservo = 0.5;
         wait(1);
-        //distance1 = srf1.read();
+        distance1 = srf1.read();
       //  distance2 = 200;
-      distance1 = 200;
+      //distance1 = 200;
         distance2 = srf2.read();
         pc.printf("\n\rDistance1:%f", distance1);
         pc.printf("\n\rDistance2:%f", distance2);
@@ -122,7 +120,7 @@
     {
         myservo = i;
         wait(1);
-     //   distance1 = srf1.read();
+        distance1 = srf1.read();
         distance2 = srf2.read();
         pc.printf("\n\rDistance1:%f", distance1);
         pc.printf("\n\rDistance2:%f", distance2);
@@ -146,7 +144,7 @@
          {
             myservo = i;
             wait(1);
-          //  distance1 = srf1.read();
+             distance1 = srf1.read();
             distance2 = srf2.read();
             pc.printf("\n\rDistance1:%f", distance1);
             pc.printf("\n\rDistance2:%f", distance2);
@@ -197,13 +195,13 @@
         count_deviation = 0;
         myservo = 0.5;
         wait(1);
-        //distance1 = srf1.read();
+        distance1 = srf1.read();
         distance2 = srf2.read();
         i = (-1*angle/180 + 0.5);
         myservo = i;
         wait(1);
-       // distance3 = srf1.read();
-       distance4 = srf2.read();
+        distance3 = srf1.read();
+        distance4 = srf2.read();
        
         if(distance3 > 100 && distance4 > 120)
         {
@@ -268,12 +266,12 @@
         count_deviation = 0;
         myservo = 0.5;
         wait(1);
-      //  distance1 = srf1.read();
+        distance1 = srf1.read();
         distance2 = srf2.read();
         i = (-1*angle/180 + 0.5);
         myservo = i;
         wait(1);
-       // distance3 = srf1.read();
+        distance3 = srf1.read();
         distance4 = srf2.read();
         if(distance3 > 100 && distance4 > 120)
         {