Bluetooth mérés program

Fork of RN42-HelloWorld by Chris Styles

Committer:
chris
Date:
Thu Mar 31 12:55:00 2011 +0000
Revision:
0:c1134839fe1a
Child:
1:581f6547e8aa

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
chris 0:c1134839fe1a 1 #include "mbed.h"
chris 0:c1134839fe1a 2
chris 0:c1134839fe1a 3 Serial rn42(p9,p10);
chris 0:c1134839fe1a 4 DigitalOut myled(LED1);
chris 0:c1134839fe1a 5
chris 0:c1134839fe1a 6 int main() {
chris 0:c1134839fe1a 7
chris 0:c1134839fe1a 8 rn42.baud(115200);
chris 0:c1134839fe1a 9
chris 0:c1134839fe1a 10 // echo back characters, toggle the LED
chris 0:c1134839fe1a 11 while (1) {
chris 0:c1134839fe1a 12 if (rn42.readable()) {
chris 0:c1134839fe1a 13 rn42.putc(rn42.getc());
chris 0:c1134839fe1a 14 myled = !myled;
chris 0:c1134839fe1a 15 }
chris 0:c1134839fe1a 16 }
chris 0:c1134839fe1a 17 }