Lab4
Dependencies: mbed HeptaBattery SDFileSystem HeptaCamera_GPS
main.cpp@16:beb20346067a, 2019-08-19 (annotated)
- Committer:
- HEPTA
- Date:
- Mon Aug 19 05:47:18 2019 +0000
- Revision:
- 16:beb20346067a
- Parent:
- 14:5e01368bf0fb
- Child:
- 18:f7f05957c268
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 0:bdbd3d6fc5d5 | 1 | #include "mbed.h" |
HEPTA | 16:beb20346067a | 2 | #include "HeptaBattery.h" |
mbed_official | 0:bdbd3d6fc5d5 | 3 | #include "SDFileSystem.h" |
umeume | 2:1c5cdb2c3e0f | 4 | #include "HeptaCamera_GPS.h" |
umeume | 2:1c5cdb2c3e0f | 5 | |
umeume | 2:1c5cdb2c3e0f | 6 | Serial pc(USBTX,USBRX); |
HEPTA | 9:942eb6e8c117 | 7 | SDFileSystem sd(p5, p6, p7, p8, "sd"); |
HEPTA | 14:5e01368bf0fb | 8 | HeptaCamera_GPS cam_gps(p13, p14,p25,p24);//(tx,rx,camera switch,gps switch) |
HEPTA | 16:beb20346067a | 9 | HeptaBattery battery(p19,p26); |
umeume | 2:1c5cdb2c3e0f | 10 | int main() |
umeume | 2:1c5cdb2c3e0f | 11 | { |
HEPTA | 14:5e01368bf0fb | 12 | pc.baud(9600); |
HEPTA | 14:5e01368bf0fb | 13 | cam_gps.gps_setting(); |
HEPTA | 14:5e01368bf0fb | 14 | int quality=0,stnum=0,gps_check=0; |
HEPTA | 14:5e01368bf0fb | 15 | char ns='A',ew='B',aunit='m'; |
HEPTA | 14:5e01368bf0fb | 16 | float time=0.0,latitude=0.0,longitude=0.0,hacu=0.0,altitude=0.0; |
HEPTA | 14:5e01368bf0fb | 17 | for(int i=1; i<10; i++) { |
HEPTA | 14:5e01368bf0fb | 18 | cam_gps.gga_sensing(&time, &latitude, &ns, &longitude, &ew, &quality, &stnum, &hacu, &altitude, &aunit, &gps_check); |
HEPTA | 14:5e01368bf0fb | 19 | if((gps_check==0)|(gps_check==1)) { |
HEPTA | 14:5e01368bf0fb | 20 | 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); |
HEPTA | 14:5e01368bf0fb | 21 | } |
HEPTA | 14:5e01368bf0fb | 22 | } |
umeume | 2:1c5cdb2c3e0f | 23 | } |