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 RN-42XVPsample by
main.cpp
00001 /* 00002 RN-42XVPによるRFCOMM通信のサンプルプログラム(mbed側) 00003 ・受け取った電文の1-4ビット目でLPC1768のLED1-4を点灯・消灯させる 00004 00005 RN-42XVP LPC1768 00006 ------------------- 00007 Pin1 VOUT 00008 Pin2 p14(rx) or p10 00009 Pin3 p13(tx) or p9 00010 Pin10 GND 00011 */ 00012 #include "mbed.h" 00013 00014 BusOut leds(LED1, LED2, LED3, LED4); 00015 Serial pc(USBTX, USBRX); // For Debug 00016 Serial xbee(p9, p10); // RN-42XVP 00017 00018 int main() 00019 { 00020 uint8_t rawData; 00021 00022 xbee.baud(115200); 00023 00024 while(1) { 00025 if (xbee.readable() == 1) { 00026 rawData = xbee.getc(); 00027 pc.printf("rawData = %02x\n", rawData); 00028 if (rawData <= 0x0f) { 00029 leds = rawData; 00030 } 00031 } 00032 } 00033 }
Generated on Tue Jul 12 2022 16:17:13 by
1.7.2
