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:
- 0:bd7cbe42d985
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Wed May 02 03:07:56 2018 +0000
@@ -0,0 +1,27 @@
+#include "mbed.h"
+//Display GPS data from GPS. I'm using a holybro GPS Receiver
+// Reference https://mikan.github.io/2017/11/07/using-pa6c-with-mbed/
+
+Serial gps(p9, p10); // TX, RX
+Serial pc(USBTX, USBRX); // TX, RX
+DigitalOut led1(LED1);
+
+int main() {
+ pc.baud(9600);
+ char gpsout[1024];
+ while (1) {
+ gpsout[0] = '\0';
+ while (1) {
+ char c = gps.getc();
+ char s[2];
+ s[0] = c;
+ s[1] = '\0';
+ strcat(gpsout, s);
+ if (c == '\n') {
+ break;
+ }
+ }
+ pc.printf(gpsout);
+ led1 = !led1;
+ }
+}
\ No newline at end of file