yokokawa

Dependencies:   ADXL345 AigamozuControlPackets HMC5843 ITG3200 MBed_Adafruit-GPS-Library XBee agzIDLIST agz_common mbed

Fork of aigamozu_program_ver2 by aigamozu

Revision:
12:3e7ad5c07976
Parent:
11:187ff22b343f
diff -r 187ff22b343f -r 3e7ad5c07976 main.cpp
--- a/main.cpp	Fri Apr 10 12:59:22 2015 +0000
+++ b/main.cpp	Fri Apr 10 13:19:19 2015 +0000
@@ -102,8 +102,6 @@
                  //Check Command Type 
                  switch(agz.checkCommnadType(buf)){
                     
-                    printf("%c\n", buf[14]);
-                    
                     //CommandType -> ChanegeMode
                     case CHANGE_MODE :{
                         agz.changeMode(buf);                                        
@@ -124,34 +122,33 @@
                             //Create GPS Infomation Packet
                             agz.createReceiveStatusCommand('B','a',myGPS.longitudeH,myGPS.longitudeL,myGPS.latitudeH,myGPS.latitudeL);
                             //Select Destination
-                            ZBTxRequest tx64request(robot_Address,agz.packetData,agz.getPacketLength());
+                                ZBTxRequest tx64request(robot_Address,agz.packetData,agz.getPacketLength());
                             //Send -> Base
                             xbee.send(tx64request);
                             break;         
           
                         }
                         
-                        case RECEIVE_STATUS:{
-                            
-                            printf("ok\n");      
-                           
-                            id = buf1[6] - 'A';
-                            robot[id].set_state(buf1[9]);
-                            robot[id].set_LatitudeH(&buf1[13]);
-                            robot[id].set_LatitudeL(&buf1[17]);
-                            robot[id].set_LongitudeH(&buf1[21]);
-                            robot[id].set_LongitudeL(&buf1[25]); 
+                    case RECEIVE_STATUS:{
                             
-                            printf("%d\n", id);                    
-                            printf("%ld, %ld, %ld, %ld\n", robot[id].get_LatitudeH(), robot[id].get_LatitudeL(), robot[id].get_LongitudeH(), robot[id].get_LongitudeL());
-                            break;
-                        }
+                        printf("Receive Status\n");      
+                           
+                        id = buf1[6] - 'A';
+                        robot[id].set_state(buf1[9]);
+                        robot[id].set_LatitudeH(&buf1[13]);
+                        robot[id].set_LatitudeL(&buf1[17]);
+                        robot[id].set_LongitudeH(&buf1[21]);
+                        robot[id].set_LongitudeL(&buf1[25]); 
+                            
+                        printf("%d\n", id);                    
+                        printf("%ld, %ld, %ld, %ld\n", robot[id].get_LatitudeH(), robot[id].get_LatitudeL(), robot[id].get_LongitudeH(), robot[id].get_LongitudeL());
+                        break;
+                    }
                     
-                        default:
-                        {
+                    default:{
                         break;
-                            }
                     }
+                }
                     
             
                 }
@@ -191,7 +188,6 @@
             collect_state++;
 
             if(collect_flag == 4){
-                printf("%d %c\n", collect_flag, collect_state);
                 collect_state = 'a';
                 collect_flag = 0;
             }