This is single way communication with the PC

Dependencies:   mbed

backup/main_backup.cpp

Committer:
akverma
Date:
2016-12-28
Revision:
1:dad12410fd2d

File content as of revision 1:dad12410fd2d:

/*#include "mbed.h"
 
DigitalOut led1(LED1);
DigitalOut led2(LED2);
 uint8_t data;
Serial pc(USBTX, USBRX);
 
void call() {
    // Note: you need to actually read from the serial to clear the RX interrupt
    data = pc.getc();
    printf("%c\n", data);
    led2 = !led2;
}
 
int main() {
    pc.attach(&call);
    while (1) {
        led1 = !led1;
        wait(0.5);
    }
}*/