Hello World program, looping back serial data over RN42 bluetooth

Dependencies:   mbed

main.cpp

Committer:
chris
Date:
2011-03-31
Revision:
0:c1134839fe1a

File content as of revision 0:c1134839fe1a:

#include "mbed.h"

Serial rn42(p9,p10);
DigitalOut myled(LED1);

int main() {

    rn42.baud(115200);

    // echo back characters, toggle the LED
    while (1) {
        if (rn42.readable()) {
            rn42.putc(rn42.getc());
            myled = !myled;
        }
    }
}