Chris Styles
/
RN42-HelloWorld
Hello World program, looping back serial data over RN42 bluetooth
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "mbed.h" 00002 00003 Serial rn42(p9,p10); 00004 DigitalOut myled(LED1); 00005 00006 int main() { 00007 00008 rn42.baud(115200); 00009 00010 // echo back characters, toggle the LED 00011 while (1) { 00012 if (rn42.readable()) { 00013 rn42.putc(rn42.getc()); 00014 myled = !myled; 00015 } 00016 } 00017 }
Generated on Tue Jul 12 2022 11:13:16 by 1.7.2