Laboratoire APP3
Dependencies: mbed
Diff: main.cpp
- Revision:
- 1:333619c7ac99
- Parent:
- 0:638b592ccbf5
diff -r 638b592ccbf5 -r 333619c7ac99 main.cpp --- a/main.cpp Wed Feb 08 18:41:36 2017 +0000 +++ b/main.cpp Thu Feb 09 16:20:28 2017 +0000 @@ -1,12 +1,21 @@ #include "mbed.h" -DigitalOut myled(LED1); +DigitalOut dout(p8); +Serial pc(USBTX, USBRX); // tx, rx +Serial uart(p13, p14); // tx, rx + int main() { + dout = 0; + wait(0.4); + dout = 1; + while(1) { - myled = 1; - wait(0.2); - myled = 0; - wait(0.2); + if(pc.readable()) { + uart.putc(pc.getc()); + } + if(uart.readable()) { + pc.putc(uart.getc()); + } } -} +} \ No newline at end of file