Example to go with my modified GPS library
Fork of GPS_HelloWorld by
main.cpp
- Committer:
- 8fromPi
- Date:
- 2013-11-02
- Revision:
- 1:bf6b98a2e480
- Parent:
- 0:6b7345059afe
File content as of revision 1:bf6b98a2e480:
/* Example showing how to hook up to different GPS modules (GlobalSat EM406a and Adafruit Ultimate GPSv3) * to emulated serial ports at different speeds */ #include "mbed.h" #include "GPS.h" GPS gpsSpark(P0_4, P0_0, 4800); GPS gpsAda(P0_12, P0_15, 9600); Serial pc(USBTX, USBRX); int main() { while (1) { if(gpsSpark.sample()) { pc.printf("set %d\t%c\t%f\t%f\t%f\t%f\t%f\n\r", takes, 'Sparkfun Breakout', gpsSpark.longitude, gpsSpark.latitude, gpsSpark.alt, gpsSpark.geoid, gpsSpark.time); } if(gpsAda.sample()) { pc.printf("set %d\t%c\t%f\t%f\t%f\t%f\t%f\n\r", takes, 'Adafruit', gpsAda.longitude, gpsAda.latitude, gpsAda.alt, gpsAda.geoid, gpsAda.time); } } }