Matthew Pybus / Mbed 2 deprecated talktoother
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"              
00002  
00003 Serial pc(USBTX, USBRX); // tx, rx
00004 DigitalOut led1(PTB8);
00005 Serial other(PTD2, PTD3);
00006  
00007 int main() {
00008 char c;
00009 char d;
00010     pc.printf("Hello World\n");
00011     while(1){
00012     c=pc.getc();
00013     d=PTD3;
00014     other.printf("%c",c);
00015     pc.printf("%c",d);
00016     
00017     led1=(~c);
00018     
00019     wait(0.1);
00020     }
00021 }