bamlormakmak

Dependencies:   mbed

main.cpp

Committer:
jaybehandsome
Date:
2017-12-08
Revision:
0:0216e64ccf1b
Child:
1:1197e9258bc7

File content as of revision 0:0216e64ccf1b:

#include "mbed.h"
Serial pc(USBTX, USBRX);
Serial bt(PA_15, PB_7);
int main(void)
{
    char ch;
    pc.baud(38400);
    bt.baud(38400);
    pc.printf("Hello World!\n\r");
    bt.printf("Hello World!\r\n");
    
    while(1)
    {
        if(bt.readable())
        {
            ch=bt.getc();
            pc.printf("%c",ch);
        }
        
        else if(pc.readable())
        {
            ch=pc.getc();
            bt.printf("%c",ch);
        }
    }
}