AVR Competition / Mbed 2 deprecated AVC_gps

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 DigitalOut led(LED_GREEN);
00004 Serial gps(PTC17, PTC16);
00005 Serial pc(USBTX, USBRX);
00006 
00007 int main(){
00008     gps.baud(4800);
00009     while (true) {
00010         char str [200];
00011         char c;
00012         if (gps.readable()){
00013             c = gps.getc();
00014             if (c == '$') {
00015                 gps.scanf ("%199s",str);
00016                 pc.printf("%s \n",str);
00017                 //while (n >= 
00018             }
00019         }else{
00020             //pc.printf("No gps data \n");
00021         }
00022         led = !led; // toggle led
00023         //wait(0.001f);
00024     }
00025 }