for textbook v4.4
Dependencies: HEPTA_SENSOR mbed HEPTA_EPS HEPTA_CDH
main.cpp@30:cd7f7385d9f5, 2020-07-22 (annotated)
- Committer:
- HeptaSatTraining2019
- Date:
- Wed Jul 22 03:21:14 2020 +0000
- Revision:
- 30:cd7f7385d9f5
- Parent:
- 26:7274f093671c
change the number of loops
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 0:bdbd3d6fc5d5 | 1 | #include "mbed.h" |
HeptaSatTraining2019 | 25:5fd40a170032 | 2 | #include "HEPTA_EPS.h" |
HeptaSatTraining2019 | 25:5fd40a170032 | 3 | #include "HEPTA_CDH.h" |
HeptaSatTraining2019 | 25:5fd40a170032 | 4 | #include "HEPTA_SENSOR.h" |
umeume | 2:1c5cdb2c3e0f | 5 | |
umeume | 2:1c5cdb2c3e0f | 6 | Serial pc(USBTX,USBRX); |
HeptaSatTraining2019 | 21:92c25e853b87 | 7 | HEPTA_EPS eps(p16,p26); |
HeptaSatTraining2019 | 25:5fd40a170032 | 8 | HEPTA_CDH cdh(p5,p6,p7,p8,"sd"); |
HeptaSatTraining2019 | 21:92c25e853b87 | 9 | HEPTA_SENSOR sensor(p17, |
HeptaSatTraining2019 | 21:92c25e853b87 | 10 | p28,p27,0xD0,0x18, |
HeptaSatTraining2019 | 25:5fd40a170032 | 11 | p13,p14,p25,p24); |
umeume | 5:c5ccb1b07e8f | 12 | |
umeume | 2:1c5cdb2c3e0f | 13 | int main() |
umeume | 2:1c5cdb2c3e0f | 14 | { |
HeptaSatTraining2019 | 26:7274f093671c | 15 | pc.baud(9600); |
HeptaSatTraining2019 | 26:7274f093671c | 16 | sensor.gps_setting(); |
HeptaSatTraining2019 | 26:7274f093671c | 17 | int quality=0,stnum=0,gps_check=0; |
HeptaSatTraining2019 | 26:7274f093671c | 18 | char ns='A',ew='B',aunit='m'; |
HeptaSatTraining2019 | 26:7274f093671c | 19 | float time=0.0,latitude=0.0,longitude=0.0,hacu=0.0,altitude=0.0; |
HeptaSatTraining2019 | 30:cd7f7385d9f5 | 20 | for(int i=1; i<1000; i++) { |
HeptaSatTraining2019 | 26:7274f093671c | 21 | sensor.gga_sensing(&time, &latitude, &ns, &longitude, &ew, &quality, &stnum, &hacu, &altitude, &aunit, &gps_check); |
HeptaSatTraining2019 | 26:7274f093671c | 22 | if((gps_check==0)|(gps_check==1)) { |
HeptaSatTraining2019 | 26:7274f093671c | 23 | 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); |
HeptaSatTraining2019 | 26:7274f093671c | 24 | } |
HeptaSatTraining2019 | 26:7274f093671c | 25 | } |
umeume | 2:1c5cdb2c3e0f | 26 | } |