Ivaylo Iltchev / Mbed 2 deprecated GPS_REPEATER

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 //------------------------------------
00004 // Hyperterminal configuration
00005 // 9600 bauds, 8-bit data, no parity
00006 //------------------------------------
00007 
00008 Serial pc(SERIAL_TX, SERIAL_RX);
00009 Serial gps(PB_10, PC_5);
00010 
00011 int main()
00012 {
00013     uint8_t c;
00014     
00015     pc.baud(4800);
00016     gps.baud(4800);
00017     
00018     pc.printf("*** GPS ***\n");
00019     while(1) {
00020         if (gps.readable()) {
00021             c = gps.getc();
00022             pc.putc(c);
00023         }
00024         if (pc.readable()) {
00025             c = pc.getc();
00026             gps.putc(c);
00027         }
00028     }
00029 }