Hepta
Dependencies: Hepta2_9axis HeptaBattery HeptaTemp HeptaXbee SDHCFileSystem mbed
Fork of HEPTA2_ALL_ver0803_02 by
main.cpp@3:4854731e663d, 2017-07-24 (annotated)
- Committer:
- hepta2ume
- Date:
- Mon Jul 24 05:54:59 2017 +0000
- Revision:
- 3:4854731e663d
- Parent:
- 2:726072016da1
- Child:
- 4:6565d9843337
Hepta_All
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hepta2ume | 2:726072016da1 | 1 | /* |
hepta2ume | 2:726072016da1 | 2 | ************************************************************* |
hepta2ume | 2:726072016da1 | 3 | H29/07_20/T.Umezawa |
hepta2ume | 2:726072016da1 | 4 | 1:SD.....OK! |
hepta2ume | 3:4854731e663d | 5 | 2:MPU9250(Accel) = OK |
hepta2ume | 3:4854731e663d | 6 | 3:MPU9250(Gyro) = OK |
hepta2ume | 3:4854731e663d | 7 | 4:MPU9250(Mag_compass) = 微妙 |
hepta2ume | 3:4854731e663d | 8 | 5:GPS sensing Mode = (サンプリング時間の修正) |
hepta2ume | 3:4854731e663d | 9 | 6:CAM Mode = OK!(微妙だった) |
hepta2ume | 3:4854731e663d | 10 | 7:Temperature sensing = OK! |
hepta2ume | 3:4854731e663d | 11 | 8:Xbee mode = OK! |
hepta2ume | 2:726072016da1 | 12 | ************************************************************* |
hepta2ume | 2:726072016da1 | 13 | */ |
sunifu | 0:0482779cd78e | 14 | #include "mbed.h" |
hepta2ume | 1:890188e041da | 15 | #include "SDHCFileSystem.h" |
hepta2ume | 2:726072016da1 | 16 | #include "HeptaXbee.h" |
hepta2ume | 1:890188e041da | 17 | #include "HeptaSerial.h" |
hepta2ume | 2:726072016da1 | 18 | #include "Hepta9axis.h" |
hepta2ume | 2:726072016da1 | 19 | #include "HeptaTemp.h" |
hepta2ume | 3:4854731e663d | 20 | #include "HeptaBattery.h" |
sunifu | 0:0482779cd78e | 21 | #define USE_JPEG_HIGH_RESOLUTION 1 |
sunifu | 0:0482779cd78e | 22 | |
hepta2ume | 2:726072016da1 | 23 | Serial pc(USBTX,USBRX); |
hepta2ume | 2:726072016da1 | 24 | SDFileSystem sd(p5, p6, p7, p8, "fs"); |
hepta2ume | 2:726072016da1 | 25 | HeptaXbee xbee(p9,p10); |
hepta2ume | 2:726072016da1 | 26 | HeptaSerial camera(p13, p14); |
hepta2ume | 2:726072016da1 | 27 | HeptaMPU9250 MPU9250(p28,p27,0xD0,0x18);//sda,scl,acc&gyro_address,mag_gyro |
hepta2ume | 2:726072016da1 | 28 | HeptaTemp heptatemp(p17); |
hepta2ume | 3:4854731e663d | 29 | HeptaBattery bat(p16,p26); |
hepta2ume | 2:726072016da1 | 30 | DigitalOut CAM_SW(p25);//CAM_control |
hepta2ume | 2:726072016da1 | 31 | DigitalOut GPS_SW(p24);//GPS_control |
hepta2ume | 2:726072016da1 | 32 | |
hepta2ume | 2:726072016da1 | 33 | int main() |
hepta2ume | 2:726072016da1 | 34 | { |
hepta2ume | 2:726072016da1 | 35 | char mode; |
hepta2ume | 2:726072016da1 | 36 | pc.baud(9600); |
hepta2ume | 2:726072016da1 | 37 | |
hepta2ume | 2:726072016da1 | 38 | while(1) { |
hepta2ume | 2:726072016da1 | 39 | |
hepta2ume | 2:726072016da1 | 40 | /* |
hepta2ume | 2:726072016da1 | 41 | ************ |
hepta2ume | 2:726072016da1 | 42 | Mode select |
hepta2ume | 2:726072016da1 | 43 | *********** |
hepta2ume | 2:726072016da1 | 44 | */ |
hepta2ume | 2:726072016da1 | 45 | pc.printf("\r\n"); |
hepta2ume | 2:726072016da1 | 46 | pc.printf("*********************************\r\n"); |
hepta2ume | 2:726072016da1 | 47 | pc.printf("Hello world.\r\n"); |
hepta2ume | 2:726072016da1 | 48 | pc.printf("My name is HEPTA2\r\n"); |
hepta2ume | 2:726072016da1 | 49 | pc.printf("Please select mode.\r\n"); |
hepta2ume | 3:4854731e663d | 50 | pc.printf("a:SD test Mode\r\n"); |
hepta2ume | 3:4854731e663d | 51 | pc.printf("b:Check Battery Level\r\n"); |
hepta2ume | 3:4854731e663d | 52 | pc.printf("c:Gyro Sening Mode\r\n"); |
hepta2ume | 3:4854731e663d | 53 | pc.printf("d:Accel Sensing Mode\r\n"); |
hepta2ume | 3:4854731e663d | 54 | pc.printf("e:Magnet Sensig Mode\r\n"); |
hepta2ume | 3:4854731e663d | 55 | pc.printf("f:GPS Test Sensing Mode\r\n"); |
hepta2ume | 3:4854731e663d | 56 | pc.printf("g:CAM Mode\r\n"); |
hepta2ume | 3:4854731e663d | 57 | pc.printf("h:Temperature Sensing Mode\r\n"); |
hepta2ume | 3:4854731e663d | 58 | pc.printf("i:Xbee Mode\r\n"); |
hepta2ume | 3:4854731e663d | 59 | pc.printf("j:Xbee & Temperature Mode\r\n");//恒温槽用 |
hepta2ume | 3:4854731e663d | 60 | pc.printf("k:All Transmitting Mode\r\n"); |
hepta2ume | 3:4854731e663d | 61 | pc.printf("l:Test Mode\r\n"); |
hepta2ume | 3:4854731e663d | 62 | pc.printf("m:Test Mode\r\n"); |
hepta2ume | 2:726072016da1 | 63 | pc.printf("*********************************\r\n"); |
hepta2ume | 2:726072016da1 | 64 | |
hepta2ume | 2:726072016da1 | 65 | mode = pc.getc(); |
hepta2ume | 2:726072016da1 | 66 | pc.printf("\r\n"); |
hepta2ume | 2:726072016da1 | 67 | pc.printf("Your select Mode = %c\r\n",mode); |
hepta2ume | 2:726072016da1 | 68 | wait(0.5); |
hepta2ume | 3:4854731e663d | 69 | |
hepta2ume | 2:726072016da1 | 70 | switch(mode) { |
hepta2ume | 3:4854731e663d | 71 | case'a': { |
hepta2ume | 2:726072016da1 | 72 | |
hepta2ume | 2:726072016da1 | 73 | printf("=============\r\n"); |
hepta2ume | 2:726072016da1 | 74 | printf("SD test Mode\r\n"); |
hepta2ume | 2:726072016da1 | 75 | printf("=============\r\n"); |
hepta2ume | 2:726072016da1 | 76 | FILE *fp = fopen("/fs/myfile.txt", "w"); |
hepta2ume | 2:726072016da1 | 77 | if(fp == NULL) { |
hepta2ume | 2:726072016da1 | 78 | pc.printf("Could not open file for write\r\n"); |
hepta2ume | 2:726072016da1 | 79 | } else { |
hepta2ume | 2:726072016da1 | 80 | fprintf(fp, "\n\rHello World!\n\r"); |
hepta2ume | 2:726072016da1 | 81 | printf("SD Check Complete!!\r\n"); |
hepta2ume | 2:726072016da1 | 82 | fclose(fp); |
hepta2ume | 2:726072016da1 | 83 | } |
hepta2ume | 2:726072016da1 | 84 | |
hepta2ume | 2:726072016da1 | 85 | |
hepta2ume | 2:726072016da1 | 86 | break; |
hepta2ume | 2:726072016da1 | 87 | }//case'1' |
hepta2ume | 2:726072016da1 | 88 | |
hepta2ume | 2:726072016da1 | 89 | /* |
hepta2ume | 3:4854731e663d | 90 | ************************ |
hepta2ume | 3:4854731e663d | 91 | Check Battery Level mode |
hepta2ume | 3:4854731e663d | 92 | ************************ |
hepta2ume | 3:4854731e663d | 93 | */ |
hepta2ume | 3:4854731e663d | 94 | case'b': { |
hepta2ume | 3:4854731e663d | 95 | float bt; |
hepta2ume | 3:4854731e663d | 96 | bat.vol(&bt); |
hepta2ume | 3:4854731e663d | 97 | pc.printf("V = %f\r\n",bt); |
hepta2ume | 3:4854731e663d | 98 | break; |
hepta2ume | 3:4854731e663d | 99 | } |
hepta2ume | 3:4854731e663d | 100 | |
hepta2ume | 3:4854731e663d | 101 | /* |
hepta2ume | 2:726072016da1 | 102 | ****************** |
hepta2ume | 2:726072016da1 | 103 | Gyro sensing mode |
hepta2ume | 2:726072016da1 | 104 | ****************** |
hepta2ume | 2:726072016da1 | 105 | */ |
sunifu | 0:0482779cd78e | 106 | |
hepta2ume | 3:4854731e663d | 107 | case'c': { |
hepta2ume | 2:726072016da1 | 108 | printf("===================\r\n"); |
hepta2ume | 2:726072016da1 | 109 | printf("Gyro sensing Mode\r\n"); |
hepta2ume | 2:726072016da1 | 110 | printf("===================\r\n"); |
hepta2ume | 2:726072016da1 | 111 | float gx,gy,gz; |
hepta2ume | 2:726072016da1 | 112 | for(int i = 0; i < 10; i++) { |
hepta2ume | 2:726072016da1 | 113 | MPU9250.sen_gyro(&gx,&gy,&gz); |
hepta2ume | 2:726072016da1 | 114 | pc.printf("GX = %f,GY = %f,GZ = %f\r\n",gx,gy,gz); |
hepta2ume | 2:726072016da1 | 115 | wait(0.5); |
hepta2ume | 2:726072016da1 | 116 | } |
hepta2ume | 2:726072016da1 | 117 | break; |
hepta2ume | 2:726072016da1 | 118 | }//case'2' |
hepta2ume | 2:726072016da1 | 119 | |
hepta2ume | 2:726072016da1 | 120 | /* |
hepta2ume | 2:726072016da1 | 121 | ****************** |
hepta2ume | 2:726072016da1 | 122 | Accel sensing mode |
hepta2ume | 2:726072016da1 | 123 | ****************** |
hepta2ume | 2:726072016da1 | 124 | */ |
hepta2ume | 2:726072016da1 | 125 | |
hepta2ume | 3:4854731e663d | 126 | case'd': { |
hepta2ume | 2:726072016da1 | 127 | printf("===================\r\n"); |
hepta2ume | 2:726072016da1 | 128 | printf("Accel sensing Mode\r\n"); |
hepta2ume | 2:726072016da1 | 129 | printf("===================\r\n"); |
hepta2ume | 2:726072016da1 | 130 | float ax,ay,az; |
hepta2ume | 2:726072016da1 | 131 | for(int i = 0; i < 10; i++) { |
hepta2ume | 2:726072016da1 | 132 | MPU9250.sen_acc(&ax,&ay,&az); |
hepta2ume | 2:726072016da1 | 133 | pc.printf("AX = %f,AY = %f,AZ = %f\r\n",ax,ay,az); |
hepta2ume | 2:726072016da1 | 134 | wait(0.5); |
hepta2ume | 2:726072016da1 | 135 | } |
hepta2ume | 2:726072016da1 | 136 | break; |
hepta2ume | 2:726072016da1 | 137 | }//case'3' |
hepta2ume | 2:726072016da1 | 138 | |
hepta2ume | 2:726072016da1 | 139 | /* |
hepta2ume | 2:726072016da1 | 140 | ****************** |
hepta2ume | 2:726072016da1 | 141 | Magnet sensing mode |
hepta2ume | 2:726072016da1 | 142 | ****************** |
hepta2ume | 2:726072016da1 | 143 | */ |
hepta2ume | 2:726072016da1 | 144 | |
hepta2ume | 3:4854731e663d | 145 | case'e': { |
hepta2ume | 2:726072016da1 | 146 | float mx,my,mz; |
hepta2ume | 2:726072016da1 | 147 | printf("===================\r\n"); |
hepta2ume | 2:726072016da1 | 148 | printf("Magnet sensing Mode\r\n"); |
hepta2ume | 2:726072016da1 | 149 | printf("===================\r\n"); |
hepta2ume | 2:726072016da1 | 150 | for(int i = 0; i < 10; i++) { |
hepta2ume | 2:726072016da1 | 151 | MPU9250.sen_mag(&mx,&my,&mz); |
hepta2ume | 2:726072016da1 | 152 | pc.printf("MX = %f,MY = %f,MZ = %f\r\n",mx,my,mz); |
hepta2ume | 2:726072016da1 | 153 | wait(0.5); |
hepta2ume | 2:726072016da1 | 154 | } |
hepta2ume | 2:726072016da1 | 155 | break; |
hepta2ume | 2:726072016da1 | 156 | }//case'4' |
hepta2ume | 2:726072016da1 | 157 | |
hepta2ume | 2:726072016da1 | 158 | /* |
hepta2ume | 2:726072016da1 | 159 | ****************** |
hepta2ume | 3:4854731e663d | 160 | GPS sensing mode |
hepta2ume | 3:4854731e663d | 161 | ****************** |
hepta2ume | 3:4854731e663d | 162 | */ |
hepta2ume | 3:4854731e663d | 163 | |
hepta2ume | 3:4854731e663d | 164 | case'f': { |
hepta2ume | 3:4854731e663d | 165 | |
hepta2ume | 3:4854731e663d | 166 | printf("===================\r\n"); |
hepta2ume | 3:4854731e663d | 167 | printf("GPS sensing Mode\r\n"); |
hepta2ume | 3:4854731e663d | 168 | printf("===================\r\n"); |
hepta2ume | 3:4854731e663d | 169 | while(1) pc.putc(camera.getc()); |
hepta2ume | 3:4854731e663d | 170 | break; |
hepta2ume | 3:4854731e663d | 171 | }//case'4' |
hepta2ume | 3:4854731e663d | 172 | |
hepta2ume | 3:4854731e663d | 173 | /* |
hepta2ume | 3:4854731e663d | 174 | ****************** |
hepta2ume | 2:726072016da1 | 175 | Cam Snapshot mode |
hepta2ume | 2:726072016da1 | 176 | ****************** |
hepta2ume | 2:726072016da1 | 177 | */ |
hepta2ume | 2:726072016da1 | 178 | |
hepta2ume | 3:4854731e663d | 179 | case'g': { |
hepta2ume | 2:726072016da1 | 180 | GPS_SW = 0; |
hepta2ume | 2:726072016da1 | 181 | CAM_SW = 1; |
hepta2ume | 2:726072016da1 | 182 | printf("\r\n"); |
hepta2ume | 2:726072016da1 | 183 | printf("==========\r\n"); |
hepta2ume | 2:726072016da1 | 184 | printf("CameraC1098\r\n"); |
hepta2ume | 2:726072016da1 | 185 | printf("==========\r\n"); |
hepta2ume | 2:726072016da1 | 186 | camera.Sync(); |
hepta2ume | 2:726072016da1 | 187 | camera.initialize(HeptaSerial::Baud115200, HeptaSerial::JpegResolution320x240); |
hepta2ume | 2:726072016da1 | 188 | camera.test_jpeg_snapshot_picture(1); |
sunifu | 0:0482779cd78e | 189 | |
hepta2ume | 2:726072016da1 | 190 | break; |
hepta2ume | 2:726072016da1 | 191 | }//case'6' |
hepta2ume | 2:726072016da1 | 192 | |
hepta2ume | 2:726072016da1 | 193 | /* |
hepta2ume | 2:726072016da1 | 194 | ****************** |
hepta2ume | 2:726072016da1 | 195 | Temp sensing mode |
hepta2ume | 2:726072016da1 | 196 | ****************** |
hepta2ume | 2:726072016da1 | 197 | */ |
hepta2ume | 2:726072016da1 | 198 | |
hepta2ume | 3:4854731e663d | 199 | case'h': { |
hepta2ume | 2:726072016da1 | 200 | printf("==================\r\n"); |
hepta2ume | 2:726072016da1 | 201 | printf("Temp sensing Mode\r\n"); |
hepta2ume | 2:726072016da1 | 202 | printf("==================\r\n"); |
hepta2ume | 2:726072016da1 | 203 | float temp; |
hepta2ume | 2:726072016da1 | 204 | for(int i = 0; i<100; i++) { |
hepta2ume | 2:726072016da1 | 205 | heptatemp.temp_sense(&temp); |
hepta2ume | 2:726072016da1 | 206 | pc.printf("%f\r\n",temp); |
hepta2ume | 2:726072016da1 | 207 | //xbee.printf("%f\r\n",temp); |
hepta2ume | 2:726072016da1 | 208 | } |
hepta2ume | 2:726072016da1 | 209 | break; |
hepta2ume | 2:726072016da1 | 210 | }//case'7' |
hepta2ume | 2:726072016da1 | 211 | |
hepta2ume | 2:726072016da1 | 212 | /* |
hepta2ume | 2:726072016da1 | 213 | *********** |
hepta2ume | 2:726072016da1 | 214 | Xbee mode |
hepta2ume | 2:726072016da1 | 215 | *********** |
hepta2ume | 2:726072016da1 | 216 | */ |
hepta2ume | 2:726072016da1 | 217 | |
hepta2ume | 3:4854731e663d | 218 | case'i': { |
hepta2ume | 2:726072016da1 | 219 | |
hepta2ume | 2:726072016da1 | 220 | int i=0,rcmd=0,cmdflag=0; |
hepta2ume | 2:726072016da1 | 221 | xbee.printf("Count Up!\r"); |
hepta2ume | 2:726072016da1 | 222 | while(1) { |
hepta2ume | 2:726072016da1 | 223 | xbee.printf("num = %d\r",i); |
hepta2ume | 2:726072016da1 | 224 | i++; |
hepta2ume | 2:726072016da1 | 225 | wait(1.0); |
hepta2ume | 2:726072016da1 | 226 | xbee.xbee_recieve(&rcmd,&cmdflag); |
hepta2ume | 2:726072016da1 | 227 | pc.printf("rcmd=%d, cmdflag=%d\r\n",rcmd, cmdflag); |
hepta2ume | 2:726072016da1 | 228 | if (cmdflag == 1) { |
hepta2ume | 2:726072016da1 | 229 | if (rcmd == 'a') { |
hepta2ume | 2:726072016da1 | 230 | pc.printf("Command Get %d\r\n",rcmd); |
hepta2ume | 2:726072016da1 | 231 | xbee.printf("HEPTA Uplink OK\r"); |
hepta2ume | 2:726072016da1 | 232 | } |
hepta2ume | 2:726072016da1 | 233 | xbee.initialize(); |
hepta2ume | 2:726072016da1 | 234 | } |
hepta2ume | 2:726072016da1 | 235 | } |
hepta2ume | 2:726072016da1 | 236 | |
hepta2ume | 2:726072016da1 | 237 | break; |
hepta2ume | 2:726072016da1 | 238 | }//case'8' |
hepta2ume | 2:726072016da1 | 239 | |
hepta2ume | 2:726072016da1 | 240 | /* |
hepta2ume | 2:726072016da1 | 241 | ****************** |
hepta2ume | 2:726072016da1 | 242 | Temp sensing mode by Xbbe |
hepta2ume | 2:726072016da1 | 243 | ****************** |
hepta2ume | 2:726072016da1 | 244 | */ |
hepta2ume | 2:726072016da1 | 245 | |
hepta2ume | 3:4854731e663d | 246 | case'j': { |
hepta2ume | 2:726072016da1 | 247 | |
hepta2ume | 2:726072016da1 | 248 | printf("==================\r\n"); |
hepta2ume | 2:726072016da1 | 249 | printf("Temp sensing Mode & Xbee\r\n"); |
hepta2ume | 2:726072016da1 | 250 | printf("==================\r\n"); |
hepta2ume | 2:726072016da1 | 251 | |
hepta2ume | 2:726072016da1 | 252 | float temp; |
hepta2ume | 3:4854731e663d | 253 | while(1) { |
hepta2ume | 3:4854731e663d | 254 | FILE *fp = fopen("/fs/myfile.csv", "a"); |
hepta2ume | 3:4854731e663d | 255 | heptatemp.temp_sense(&temp); |
hepta2ume | 3:4854731e663d | 256 | pc.printf("%f\r\n",temp); |
hepta2ume | 3:4854731e663d | 257 | xbee.printf("%f\r\n",temp); |
hepta2ume | 3:4854731e663d | 258 | fprintf(fp, "%f\n",temp); |
hepta2ume | 3:4854731e663d | 259 | fclose(fp); |
hepta2ume | 3:4854731e663d | 260 | } |
hepta2ume | 2:726072016da1 | 261 | break; |
hepta2ume | 2:726072016da1 | 262 | }//case'9' |
hepta2ume | 2:726072016da1 | 263 | |
hepta2ume | 2:726072016da1 | 264 | /* |
hepta2ume | 2:726072016da1 | 265 | ********************* |
hepta2ume | 2:726072016da1 | 266 | All Transmitting Mode |
hepta2ume | 2:726072016da1 | 267 | ********************* |
hepta2ume | 2:726072016da1 | 268 | */ |
hepta2ume | 2:726072016da1 | 269 | |
hepta2ume | 3:4854731e663d | 270 | case'k': { |
hepta2ume | 2:726072016da1 | 271 | |
hepta2ume | 2:726072016da1 | 272 | printf("==================\r\n"); |
hepta2ume | 2:726072016da1 | 273 | printf("All Transmitting Mode\r\n"); |
hepta2ume | 2:726072016da1 | 274 | printf("==================\r\n"); |
hepta2ume | 2:726072016da1 | 275 | 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]; |
hepta2ume | 2:726072016da1 | 276 | char ddata[60]; |
hepta2ume | 2:726072016da1 | 277 | int dsize[6]; |
hepta2ume | 2:726072016da1 | 278 | while(1) { |
hepta2ume | 3:4854731e663d | 279 | |
hepta2ume | 2:726072016da1 | 280 | MPU9250.sen_gyro_u16(gx,gy,gz,&dsize[0]); |
hepta2ume | 2:726072016da1 | 281 | MPU9250.sen_acc_u16(ax,ay,az,&dsize[1]); |
hepta2ume | 2:726072016da1 | 282 | MPU9250.sen_mag_u16(mx,my,mz,&dsize[2]); |
hepta2ume | 3:4854731e663d | 283 | camera.lat_log_sensing_u16(lad,log,&dsize[3]); |
hepta2ume | 3:4854731e663d | 284 | bat.vol_u16(bt,&dsize[4]); |
hepta2ume | 2:726072016da1 | 285 | heptatemp.temp_sense_u16(temp,&dsize[5]); |
hepta2ume | 2:726072016da1 | 286 | 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); |
hepta2ume | 2:726072016da1 | 287 | } |
hepta2ume | 2:726072016da1 | 288 | break; |
hepta2ume | 2:726072016da1 | 289 | }//case'9' |
hepta2ume | 2:726072016da1 | 290 | /* |
hepta2ume | 2:726072016da1 | 291 | ****************** |
hepta2ume | 2:726072016da1 | 292 | Cam Snapshot mode |
hepta2ume | 2:726072016da1 | 293 | ****************** |
hepta2ume | 2:726072016da1 | 294 | */ |
hepta2ume | 2:726072016da1 | 295 | |
hepta2ume | 3:4854731e663d | 296 | case'l': { |
hepta2ume | 2:726072016da1 | 297 | GPS_SW = 0; |
hepta2ume | 2:726072016da1 | 298 | CAM_SW = 1; |
hepta2ume | 2:726072016da1 | 299 | printf("\r\n"); |
hepta2ume | 2:726072016da1 | 300 | printf("==========\r\n"); |
hepta2ume | 2:726072016da1 | 301 | printf("CameraC1098\r\n"); |
hepta2ume | 2:726072016da1 | 302 | printf("==========\r\n"); |
hepta2ume | 2:726072016da1 | 303 | camera.Sync(); |
hepta2ume | 2:726072016da1 | 304 | camera.initialize(HeptaSerial::Baud115200, HeptaSerial::JpegResolution320x240); |
hepta2ume | 2:726072016da1 | 305 | camera.test_jpeg_snapshot_data(1); |
hepta2ume | 2:726072016da1 | 306 | |
hepta2ume | 2:726072016da1 | 307 | break; |
hepta2ume | 2:726072016da1 | 308 | }//case'6' |
hepta2ume | 2:726072016da1 | 309 | |
hepta2ume | 3:4854731e663d | 310 | case'm': { |
hepta2ume | 3:4854731e663d | 311 | pc.printf("L:GPS GPGGA Mode\r\n"); |
hepta2ume | 3:4854731e663d | 312 | int quality=0,stnum=0,gps_check=0; |
hepta2ume | 3:4854731e663d | 313 | char ns='A',ew='B',aunit='m'; |
hepta2ume | 3:4854731e663d | 314 | float time=0.0,latitude=0.0,longitude=0.0,hacu=0.0,altitude=0.0; |
hepta2ume | 3:4854731e663d | 315 | for(int i=1; i<10; i++) { |
hepta2ume | 3:4854731e663d | 316 | camera.gga_sensing(&time, &latitude, &ns, &longitude, &ew, &quality, &stnum, &hacu, &altitude, &aunit, &gps_check); |
hepta2ume | 3:4854731e663d | 317 | if((gps_check==0)|(gps_check==1)) { |
hepta2ume | 3:4854731e663d | 318 | pc.printf("GPGGA,%f,%f,%c,%f,%c,%d,%d,%f,%f,%c\r\n",time,latitude,ns,longitude,ew,quality,stnum,hacu,altitude,aunit); |
hepta2ume | 3:4854731e663d | 319 | } |
hepta2ume | 3:4854731e663d | 320 | } |
hepta2ume | 3:4854731e663d | 321 | break; |
hepta2ume | 3:4854731e663d | 322 | } |
hepta2ume | 3:4854731e663d | 323 | |
hepta2ume | 2:726072016da1 | 324 | default: |
hepta2ume | 2:726072016da1 | 325 | break; |
hepta2ume | 2:726072016da1 | 326 | |
hepta2ume | 2:726072016da1 | 327 | |
hepta2ume | 2:726072016da1 | 328 | } |
hepta2ume | 2:726072016da1 | 329 | } |
hepta2ume | 2:726072016da1 | 330 | } |