Hepta

Dependencies:   Hepta2_9axis HeptaBattery HeptaTemp HeptaXbee SDHCFileSystem mbed

Fork of HEPTA2_ALL_ver0803_02 by Hepta 2

Revision:
5:aedf4491aa0f
Parent:
4:6565d9843337
Child:
6:a61510510f54
--- a/main.cpp	Wed Jul 26 06:24:09 2017 +0000
+++ b/main.cpp	Sat Aug 05 13:37:01 2017 +0000
@@ -1,17 +1,3 @@
-/*
-*************************************************************
-H29/07_20/T.Umezawa
-1:SD.....OK!
-2:MPU9250(Accel) = OK
-3:MPU9250(Gyro) = OK
-4:MPU9250(Mag_compass) = 微妙
-5:GPS sensing Mode =
-6:CAM Mode = OK!(微妙だった)
-7:Temperature sensing = OK!
-8:Xbee mode = OK!
-*************************************************************
-*/
-
 #include "mbed.h"
 #include "SDHCFileSystem.h"
 #include "HeptaXbee.h"
@@ -65,7 +51,7 @@
         pc.printf("o:All Transmitting Mode\r\n");
         pc.printf("*********************************\r\n");
 
-        mode = pc.getc();
+        mode = xbee.getc();
         pc.printf("\r\n");
         pc.printf("Your select Mode = %c\r\n",mode);
         wait(0.5);
@@ -225,7 +211,7 @@
                 printf("CameraC1098\r\n");
                 printf("==========\r\n");
                 //camera.Sync();
-                camera.initialize(HeptaSerial::Baud115200, HeptaSerial::JpegResolution320x240);
+                //camera.initialize(HeptaSerial::Baud115200, HeptaSerial::JpegResolution320x240);
                 camera.test_jpeg_snapshot_picture(1);
 
                 break;
@@ -245,7 +231,7 @@
                 printf("CameraC1098\r\n");
                 printf("==========\r\n");
                 //camera.Sync();
-                camera.initialize(HeptaSerial::Baud115200, HeptaSerial::JpegResolution320x240);
+                //camera.initialize(HeptaSerial::Baud115200, HeptaSerial::JpegResolution320x240);
                 camera.test_jpeg_snapshot_data(1);
 
                 break;
@@ -261,7 +247,7 @@
                 printf("CameraC1098\r\n");
                 printf("==========\r\n");
                 //camera.Sync();
-                camera.initialize(HeptaSerial::Baud115200, HeptaSerial::JpegResolution320x240);
+                //camera.initialize(HeptaSerial::Baud115200, HeptaSerial::JpegResolution320x240);
                 camera.test_jpeg_snapshot_picture(1);
 
                 FILE *fp = fopen("/fs/test.txt", "r");
@@ -362,18 +348,18 @@
                 printf("==================\r\n");
                 printf("All Transmitting Mode\r\n");
                 printf("==================\r\n");
-                char gx[4],gy[4],gz[4],ax[4],ay[4],az[4],mx[4],my[4],mz[4],lad[8],log[8],bt[4],temp[4];
-                char ddata[60];
-                int dsize[6];
+                char gx[4],gy[4],gz[4],ax[4],ay[4],az[4],mx[4],my[4],mz[4],lad[8],log[8],height[4],bt[4],temp[4];
+                char ddata[64];
+                int dsize[7];
                 while(1) {
 
                     MPU9250.sen_gyro_u16(gx,gy,gz,&dsize[0]);
                     MPU9250.sen_acc_u16(ax,ay,az,&dsize[1]);
                     MPU9250.sen_mag_u16(mx,my,mz,&dsize[2]);
-                    camera.lat_log_sensing_u16(lad,log,&dsize[3]);
-                    bat.vol_u16(bt,&dsize[4]);
-                    heptatemp.temp_sense_u16(temp,&dsize[5]);
-                    xbee.xbee_transmit(ddata,60,gx,gy,gz,ax,ay,az,mx,my,mz,lad,log,bt,temp,dsize[0],dsize[0],dsize[0],dsize[1],dsize[1],dsize[1],dsize[2],dsize[2],dsize[2],dsize[3],dsize[3],dsize[4],dsize[5],13);
+                    camera.lat_log_sensing_u16(lad,log,height,&dsize[3],&dsize[4]);
+                    bat.vol_u16(bt,&dsize[5]);
+                    heptatemp.temp_sense_u16(temp,&dsize[6]);
+                    xbee.xbee_transmit(ddata,64,gx,gy,gz,ax,ay,az,mx,my,mz,lad,log,height,bt,temp,dsize[0],dsize[0],dsize[0],dsize[1],dsize[1],dsize[1],dsize[2],dsize[2],dsize[2],dsize[3],dsize[3],dsize[4],dsize[5],dsize[6],14);
                 }
                 break;
             }//case'9'