Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: HEPTA_CDH HEPTA_EPS HEPTA_SENSOR mbed
Diff: main.cpp
- Revision:
- 26:7274f093671c
- Parent:
- 25:5fd40a170032
- Child:
- 30:cd7f7385d9f5
--- a/main.cpp Tue Aug 27 01:15:05 2019 +0000
+++ b/main.cpp Tue Aug 27 01:21:16 2019 +0000
@@ -2,7 +2,6 @@
#include "HEPTA_EPS.h"
#include "HEPTA_CDH.h"
#include "HEPTA_SENSOR.h"
-#include "HEPTA_COM.h"
Serial pc(USBTX,USBRX);
HEPTA_EPS eps(p16,p26);
@@ -10,14 +9,18 @@
HEPTA_SENSOR sensor(p17,
p28,p27,0xD0,0x18,
p13,p14,p25,p24);
-HEPTA_COM com(p9,p10);
-
-DigitalOut myled(LED1);
int main()
{
- myled = 1;
- wait(0.5);
- myled = 0;
- wait(0.5);
+ pc.baud(9600);
+ sensor.gps_setting();
+ int quality=0,stnum=0,gps_check=0;
+ char ns='A',ew='B',aunit='m';
+ float time=0.0,latitude=0.0,longitude=0.0,hacu=0.0,altitude=0.0;
+ for(int i=1; i<10; i++) {
+ sensor.gga_sensing(&time, &latitude, &ns, &longitude, &ew, &quality, &stnum, &hacu, &altitude, &aunit, &gps_check);
+ if((gps_check==0)|(gps_check==1)) {
+ 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);
+ }
+ }
}
\ No newline at end of file