Untested
Dependencies: mbed MBed_Adafruit-GPS-Library2
Revision 0:fded98c5935f, committed 2019-09-12
- Comitter:
- fconboy
- Date:
- Thu Sep 12 15:41:41 2019 +0000
- Commit message:
- Untested
Changed in this revision
diff -r 000000000000 -r fded98c5935f MBed_Adafruit-GPS-Library.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MBed_Adafruit-GPS-Library.lib Thu Sep 12 15:41:41 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/fconboy/code/MBed_Adafruit-GPS-Library2/#526e7273d328
diff -r 000000000000 -r fded98c5935f main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Sep 12 15:41:41 2019 +0000 @@ -0,0 +1,34 @@ +//gps.cpp +//for use with Adafruit Ultimate GPS +//Reads in and parses GPS data + +#include "mbed.h" +#include "MBed_Adafruit_GPS.h" + +Serial * gps_Serial; +Serial pc(USBTX, USBRX); +DigitalOut led1(LED1); + +int main() { + + pc.baud(115200); //sets virtual COM serial communication to high rate; this is to allow more time to be spent on GPS retrieval + + pc.printf("\r\n\nProgram start\r\n"); + gps_Serial = new Serial(p13,p14); //serial object for use w/ GPS + Adafruit_GPS myGPS(gps_Serial); //object of Adafruit's GPS class + char c; //when read via Adafruit_GPS::read(), the class returns single character stored here + myGPS.begin(9600); //sets baud rate for GPS communication; note this may be changed via Adafruit_GPS::sendCommand(char *) + //a list of GPS commands is available at http://www.adafruit.com/datasheets/PMTK_A08.pdf + wait(1); + myGPS.sendCommand("$PMTK314,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n"); //Command to only send RMC packets + + + + while(true){ + + c = myGPS.read(); //queries the GPS + pc.printf("%c",c);//this line will echo the GPS data if not paused + + + } +} \ No newline at end of file
diff -r 000000000000 -r fded98c5935f mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Sep 12 15:41:41 2019 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/e95d10626187 \ No newline at end of file