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.
main.cpp
00001 /* Program Example 12.4: Paired Bluetooth master program 00002 */ 00003 #include "mbed.h" 00004 Serial rn41(p9,p10); 00005 BusOut led(LED4,LED3,LED2,LED1); 00006 DigitalIn Din(p26); // digital switch input on pin 14 00007 00008 char x; 00009 void initialise_connection(void); 00010 00011 int main() { 00012 rn41.baud(115200); 00013 initialise_connection(); 00014 while (1) { 00015 if (Din==1) { // if digital input switched high 00016 x=0x0F; // override with 0x0F 00017 } else { 00018 x++; // else increment and 00019 if (x>0x0F) { // output count value 00020 x=0; 00021 } 00022 } 00023 rn41.putc(x); // send char data on serial 00024 led = x; // set LEDs to count in binary 00025 wait(0.5); 00026 } 00027 } 00028 00029 // add function initialise_connection code here... 00030
Generated on Mon Aug 22 2022 01:30:50 by
1.7.2