my first test rpogram

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 
00004 DigitalOut   myLed1(LED1);
00005 DigitalOut   myLed2(LED2);
00006 DigitalOut   myLed3(LED3); //The pushbutton or power on caused a reset
00007 DigitalOut   myLed4(LED4); //The watchdog timer caused a reset
00008 Serial pc(USBTX, USBRX);    // tx, rx
00009 Serial gps(p28,p27);    // tx, rx
00010 char msg;
00011 T myFunc()
00012 {
00013     return T();
00014 }
00015 
00016 int main() 
00017 {
00018     T t = myFunc();
00019     
00020     pc.baud(115200);
00021     gps.baud(38400);
00022     while(1) {
00023         
00024         while(gps.getc() != '$');
00025         msg = gps.getc();
00026         pc.printf("%c",msg);
00027         
00028        
00029     }
00030 }