![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Mbed with low-cost serial BR355 GPS using RS232 breakout and PS/2 breakout for power.
main.cpp@0:98ae71628dbf, 2011-02-25 (annotated)
- Committer:
- snavare3
- Date:
- Fri Feb 25 20:02:14 2011 +0000
- Revision:
- 0:98ae71628dbf
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
snavare3 | 0:98ae71628dbf | 1 | #include "mbed.h" |
snavare3 | 0:98ae71628dbf | 2 | #include "GPS.h" |
snavare3 | 0:98ae71628dbf | 3 | |
snavare3 | 0:98ae71628dbf | 4 | Serial pc(USBTX, USBRX); |
snavare3 | 0:98ae71628dbf | 5 | GPS gps(p9, p10); |
snavare3 | 0:98ae71628dbf | 6 | |
snavare3 | 0:98ae71628dbf | 7 | int main() { |
snavare3 | 0:98ae71628dbf | 8 | while(1) { |
snavare3 | 0:98ae71628dbf | 9 | //wait(0.1); |
snavare3 | 0:98ae71628dbf | 10 | //pc.printf("\nHello world\n\r"); |
snavare3 | 0:98ae71628dbf | 11 | //printf ("\n\r the value of GPS sample is : %d\n\r", gps.sample()); |
snavare3 | 0:98ae71628dbf | 12 | if(gps.sample()) { |
snavare3 | 0:98ae71628dbf | 13 | pc.printf("I'm at %f, %f\n\r", gps.longitude, gps.latitude); |
snavare3 | 0:98ae71628dbf | 14 | } else { |
snavare3 | 0:98ae71628dbf | 15 | pc.printf("Oh Dear! No lock :(\n\r"); |
snavare3 | 0:98ae71628dbf | 16 | } |
snavare3 | 0:98ae71628dbf | 17 | } |
snavare3 | 0:98ae71628dbf | 18 | } |
snavare3 | 0:98ae71628dbf | 19 | |
snavare3 | 0:98ae71628dbf | 20 | |
snavare3 | 0:98ae71628dbf | 21 | /* |
snavare3 | 0:98ae71628dbf | 22 | $GPRMC,000115.039,V,,,,,,,291006,,*2C |
snavare3 | 0:98ae71628dbf | 23 | $GPGGA,000116.031,,,,,0,00,,,M,0.0,M,,0000*52 |
snavare3 | 0:98ae71628dbf | 24 | $GPGSA,A,1,,,,,,,,,,,,,,,*1E |
snavare3 | 0:98ae71628dbf | 25 | $GPGSV,3,1,12,20,00,000,,10,00,000,,31,00,000,,27,00,000,*7C |
snavare3 | 0:98ae71628dbf | 26 | $GPGSV,3,2,12,19,00,000,,07,00,000,,04,00,000,,24,00,000,*76 |
snavare3 | 0:98ae71628dbf | 27 | $GPGSV,3,3,12,16,00,000,,28,00,000,,26,00,000,,29,00,000,*78 |
snavare3 | 0:98ae71628dbf | 28 | $GPRMC,000116.031,V,,,,,,,291006,,*27 |
snavare3 | 0:98ae71628dbf | 29 | $GPGGA,000117.035,,,,,0,00,,,M,0.0,M,,0000*57 |
snavare3 | 0:98ae71628dbf | 30 | $GPGSA,A,1,,,,,,,,,,,,,,,*1E |
snavare3 | 0:98ae71628dbf | 31 | $GPRMC,000117.035,V,,,,,,,291006,,*22 |
snavare3 | 0:98ae71628dbf | 32 | $GPGGA,000118.039,,,,,0,00,,,M,0.0,M,,0000*54 |
snavare3 | 0:98ae71628dbf | 33 | $GPGSA,A,1,,,,,,,,,,,,,,,*1E |
snavare3 | 0:98ae71628dbf | 34 | $GPRMC,000118.039,V,,,,,,,291006,,*21 |
snavare3 | 0:98ae71628dbf | 35 | $GPGGA,000119.035,,,,,0,00,,,M,0.0,M,,0000*59 |
snavare3 | 0:98ae71628dbf | 36 | $GPGSA,A,1,,,,,,,,,,,,,,,*1E |
snavare3 | 0:98ae71628dbf | 37 | $GPRMC,000119.035,V,,,,,,,291006,,*2C |
snavare3 | 0:98ae71628dbf | 38 | $GPGGA,000120.037,,,,,0,00,,,M,0.0,M,,0000*51 |
snavare3 | 0:98ae71628dbf | 39 | $GPGSA,A,1,,,,,,,,,,,,,,,*1E |
snavare3 | 0:98ae71628dbf | 40 | $GPRMC,000120.037,V,,,,,,,291006,,*24 |
snavare3 | 0:98ae71628dbf | 41 | */ |