Testing documentation

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.h Source File

main.h

00001 /** @defgroup API The MODGPS API */
00002 
00003 /** GPS module
00004  * @author Andy Kirkham
00005  * @see http://mbed.org/cookbook/MODGPS
00006  * @see example1.cpp
00007  * @see example2.cpp
00008  * @see API 
00009  *
00010  * @image html /media/uploads/AjK/gps_interfaces.png "Wiring up the GPS module"
00011  *
00012  * Example:
00013  * @code
00014  * #include "mbed.h"
00015  * #include "GPS.h"
00016  *
00017  * DigitalOut led1(LED1);
00018  * Serial pc(USBTX, USBRX);
00019  * GPS gps(NC, p10); 
00020  *
00021  * int main() {
00022  *     GPS_Time t;
00023  *
00024  *     // Wait for the GPS NMEA data to become valid.
00025  *     while (!gps.isTimeValid()) {
00026  *       led1 = !led1;
00027  *       wait(1);
00028  *     }
00029  *
00030  *     gps.timeNow(&t);
00031  *
00032  *     pc.printf("The time/date is %02d:%02d:%02d %02d/%02d/%04d\r\n",
00033  *        t.hour, t.minute, t.second, t.day, t.month, t.year);
00034  *
00035  *     // Wait until at least four satellites produce a position fix and a valid quality.
00036  *     while (gps.numOfSats() < 4 && gps.getGPSquality != 0) {
00037  *       led1 = !led1;
00038  *       wait(1);
00039  *     }
00040  *
00041  *     pc.printf("Lat = %.4f Lon = %.4f Alt = %.1fkm\r\n", 
00042  *         gps.latitude(), gps.longitude, gps.altitude());
00043  *
00044  *     // Make the LED go steady to indicate we have finished.
00045  *     led1 = 1;
00046  * 
00047  *     while(1) {}
00048  * }
00049  * @endcode
00050  */