wef

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 PwmOut r(LED_RED);
00004 PwmOut g(LED_GREEN);
00005 Serial pc(USBTX, USBRX);
00006 
00007 void RX_handler(void);
00008 
00009 int main()
00010 {
00011     r.period(0.001f);
00012     g.period(0.001f);
00013 
00014     r = 1;
00015     g = 1;
00016     
00017     pc.attach(&RX_handler);
00018     
00019     while(1)
00020     {
00021         wait(0.2);
00022     }
00023 }
00024 
00025 void RX_handler(void)
00026 {
00027     while(pc.readable())
00028     {
00029         pc.putc(pc.getc());
00030     }
00031 }