Template for LAB10_Oppgave3
Dependencies: mbed
Import program
00001 #include "mbed.h" 00002 00003 Serial serial3(PB_9, PB_8); // tx, rx 00004 Serial pc(USBTX, USBRX); // tx, rx 00005 00006 void serial3Rx() 00007 { pc.putc(serial3.getc()); 00008 } 00009 00010 void pcRx() 00011 { serial3.putc(pc.getc()); 00012 } 00013 00014 int main() 00015 { 00016 serial3.attach(&serial3Rx); 00017 pc.attach(&pcRx); 00018 00019 while(1) { 00020 wait(1); 00021 } 00022 } 00023 00024 00025 00026
Diff: main.cpp
- Revision:
- 1:05b1d2a203e5
- Parent:
- 0:00b5baa80198
diff -r 00b5baa80198 -r 05b1d2a203e5 main.cpp --- a/main.cpp Wed Nov 04 20:58:44 2015 +0000 +++ b/main.cpp Wed Nov 04 21:02:48 2015 +0000 @@ -4,25 +4,21 @@ Serial pc(USBTX, USBRX); // tx, rx void serial3Rx() -{ - putchar(serial3.getc()); +{ pc.putc(serial3.getc()); } void pcRx() -{ - serial3.putc(pc.getc()); +{ serial3.putc(pc.getc()); } -int main() -{ +int main() +{ serial3.attach(&serial3Rx); pc.attach(&pcRx); - - - while(1) - { - wait(1); - } + + while(1) { + wait(1); + } }