Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of RN42-HelloWorld by
main.cpp@1:581f6547e8aa, 2013-03-03 (annotated)
- Committer:
- szabolor
- Date:
- Sun Mar 03 10:45:04 2013 +0000
- Revision:
- 1:581f6547e8aa
- Parent:
- 0:c1134839fe1a
- Child:
- 2:584102a0bf36
kezdeti commit:; Az analog-r?l olvas ?s ?rja a bluetoothra
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
chris | 0:c1134839fe1a | 1 | #include "mbed.h" |
chris | 0:c1134839fe1a | 2 | |
szabolor | 1:581f6547e8aa | 3 | AnalogIn an(p15); |
chris | 0:c1134839fe1a | 4 | Serial rn42(p9,p10); |
szabolor | 1:581f6547e8aa | 5 | Serial pc(USBTX, USBRX); |
chris | 0:c1134839fe1a | 6 | DigitalOut myled(LED1); |
szabolor | 1:581f6547e8aa | 7 | int c; |
chris | 0:c1134839fe1a | 8 | |
chris | 0:c1134839fe1a | 9 | int main() { |
chris | 0:c1134839fe1a | 10 | |
chris | 0:c1134839fe1a | 11 | rn42.baud(115200); |
szabolor | 1:581f6547e8aa | 12 | pc.baud(460800); |
chris | 0:c1134839fe1a | 13 | // echo back characters, toggle the LED |
chris | 0:c1134839fe1a | 14 | while (1) { |
szabolor | 1:581f6547e8aa | 15 | while (rn42.readable()) { |
szabolor | 1:581f6547e8aa | 16 | c = rn42.getc(); |
szabolor | 1:581f6547e8aa | 17 | pc.putc(c); |
chris | 0:c1134839fe1a | 18 | } |
szabolor | 1:581f6547e8aa | 19 | c.printf("%f",an*3.3); |
chris | 0:c1134839fe1a | 20 | } |
chris | 0:c1134839fe1a | 21 | } |