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.
Diff: main.cpp
- Revision:
- 2:17b641282f3f
- Parent:
- 1:6bba24a04008
- Child:
- 3:ddb2f0c269f2
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