Bluetooth mérés program
Fork of RN42-HelloWorld by
Diff: main.cpp
- Revision:
- 1:581f6547e8aa
- Parent:
- 0:c1134839fe1a
- Child:
- 2:584102a0bf36
--- a/main.cpp Thu Mar 31 12:55:00 2011 +0000 +++ b/main.cpp Sun Mar 03 10:45:04 2013 +0000 @@ -1,17 +1,21 @@ #include "mbed.h" +AnalogIn an(p15); Serial rn42(p9,p10); +Serial pc(USBTX, USBRX); DigitalOut myled(LED1); +int c; int main() { rn42.baud(115200); - + pc.baud(460800); // echo back characters, toggle the LED while (1) { - if (rn42.readable()) { - rn42.putc(rn42.getc()); - myled = !myled; + while (rn42.readable()) { + c = rn42.getc(); + pc.putc(c); } + c.printf("%f",an*3.3); } }