Oxford cwm serial 01

Dependencies:   mbed

main.cpp

Committer:
codabash
Date:
2013-05-01
Revision:
0:a2a851b6a23f

File content as of revision 0:a2a851b6a23f:

#include "mbed.h"

DigitalOut l1(LED1);
DigitalOut l2(LED2);
DigitalOut l3(LED3);

Serial talky(PTC4, PTC3);
Serial pc(USBTX, USBRX);

int main() {

l1=1;
l2=1;
l3=1;
    while(1) {
    if (pc.readable() && talky.writeable()){
    char c = pc.getc();
    l1=!l1;
    talky.putc(c);
    wait(0.01);
    l1=!l1;
    }
    if (talky.readable() && pc.writeable()){
    l2=!l2;
    char c2 = talky.getc();
    wait(0.01);
    l2=!l2;
    pc.putc(c2);
        }  
    wait(0.01);
    }
}