fork 1

Dependencies:   mbed

Fork of eic_blinky_interrupt by 尚人 永井

main.cpp

Committer:
cless_albein
Date:
2014-05-20
Revision:
1:47e9b18377b9
Parent:
0:866573259a54
Child:
2:ab5ef3f84cd5

File content as of revision 1:47e9b18377b9:

#include "mbed.h"

Serial pc(USBTX,USBRX);//tx,rx
AnalogOut led_y(p18);

void pc_rx();

int main()
{
    pc.attach(&pc_rx,Serial::RxIrq);
    while(1) {
        sleep();
        //pc.printf("wakeup\r\n");
    }
}

void pc_rx ()
{
    char buff=pc.getc();
    pc.putc(buff);
    if(65<=buff&&buff<='Z') {
        pc.putc(buff+0x20);
    } else if('a'<=buff&&buff<='z') {
        pc.putc(buff-0x20);
    }
    pc.printf("\r\n");


}