apenas pega nos dados recebidos do simulador de GPS na porta uart2 e envia processada para o pc. A FUNCIONAR!

Dependencies:   SerialGPS mbed

Fork of Sparkfun_GPS_Shield by Shields

Files at this revision

API Documentation at this revision

Comitter:
Charrua
Date:
Wed Jul 12 10:58:32 2017 +0000
Parent:
1:6bba24a04008
Commit message:
teste

Changed in this revision

SerialGPS.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 6bba24a04008 -r 17b641282f3f SerialGPS.lib
--- a/SerialGPS.lib	Fri Jul 25 12:25:21 2014 +0000
+++ b/SerialGPS.lib	Wed Jul 12 10:58:32 2017 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/teams/components/code/SerialGPS/#4e2136c38f29
+http://developer.mbed.org/teams/components/code/SerialGPS/#4e2136c38f29
diff -r 6bba24a04008 -r 17b641282f3f main.cpp
--- a/main.cpp	Fri Jul 25 12:25:21 2014 +0000
+++ b/main.cpp	Wed Jul 12 10:58:32 2017 +0000
@@ -22,23 +22,27 @@
 /** On many platforms USBTX/USBRX overlap with serial on D1/D0 pins and enabling the below will interrupt the communication.
  *  You can use an LCD display to print the values or store them on an SD card etc.
  */
-//Serial pc(USBTX, USBRX);
+Serial pc(USBTX, USBRX); Porta série da ficha SDA da placa, usa o putty ou outro terminal tipo teraterm ou mobaxterm com a porta série que o pc configura para mbed
 
 /**
  * D1 - TX pin (RX on the GPS module side)
  * D0 - RX pin (TX on the GPS module side)
  * 4800 - GPS baud rate
  */
-SerialGPS gps(D1, D0, 4800);
+SerialGPS gps(PTE22, PTE23, 9600);  // PTE23 - liga no Tx do conversor e PTE23 no Rx do conversor, atenção à porta série que o teu pc atribui ao conversor
 
 DigitalOut myled(LED1);
 
-int main() {
+main(void) {
+    int erro;
     while (1) {
+        pc.printf("Hello World!\n\r");
+        
+        myled = myled ? 0 : 1;
         if (gps.sample()) {
-            myled = myled ? 0 : 1;
-            printf("sats %d, long %f, lat %f, alt %f, geoid %f, time %f\n\r", gps.sats, gps.longitude, gps.latitude, gps.alt, gps.geoid, gps.time);
-            wait(1);
+        pc.printf("sats %d, long %f, lat %f, alt %f, geoid %f, time %f\n\r", gps.sats, gps.longitude, gps.latitude, gps.alt, gps.geoid, gps.time);
         }
+        wait(1);
+        
     }
 }
\ No newline at end of file
diff -r 6bba24a04008 -r 17b641282f3f mbed.bld
--- a/mbed.bld	Fri Jul 25 12:25:21 2014 +0000
+++ b/mbed.bld	Wed Jul 12 10:58:32 2017 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/04dd9b1680ae
\ No newline at end of file
+https://mbed.org/users/mbed_official/code/mbed/builds/22da6e220af6
\ No newline at end of file