An XBee ZB Coordinator on a Nucleo Board controls LEDs on the other XBee ZB device.
Please refer to the following site for the details:
- http://developer.mbed.org/users/bokunimowakaru/code/xbee/wiki/Homepage (English)
- http://www.geocities.jp/bokunimowakaru/diy/xbee/xbee-nucleo.html (Japanese)
Diff: main.cpp
- Revision:
- 5:5cc827c15cf8
- Parent:
- 0:56f4884d346b
diff -r 4ea0b1d60d25 -r 5cc827c15cf8 main.cpp --- a/main.cpp Fri Sep 26 13:01:22 2014 +0000 +++ b/main.cpp Sat Oct 04 02:00:07 2014 +0000 @@ -1,6 +1,13 @@ /********************************************************************* サンプルアプリ1 リモート先のLEDをON/OFFする。 +Sample Code 1 LED +An XBee ZB Coordinator on a Nucleo Board controls LEDs on the other +XBee ZB device. +When you will use this anything other than Nucleo microcomputer board, +please change the 4th line of xbee/xbee.cpp: +RawSerial _xbee_serial(SERIAL_TX, SERIAL_RX); + 本ソースリストおよびソフトウェアは、ライセンスフリーです。 利用、編集、再配布等が自由に行えますが、著作権表示の改変は禁止します。 @@ -17,15 +24,14 @@ int main(){ // お手持ちのXBee子機(リモート先)アドレスに変更して下さい ↓ + // Please set MAC Address to access your remote XBee device. byte dev_gpio[] = {0x00,0x13,0xA2,0x00,0x40,0x30,0xC1,0x6F}; - // 初期化処理 myled = 1; // NUCLEOのLEDをHレベル(3.3V)へ xbee_init( 0 ); // XBee用COMポートの初期化 xbee_atnj( 0xFF ); // デバイスの参加を受け入れる myled = 0; // NUCLEOのLEDをHレベル(3.3V)へ - // メイン処理 while(1){ // 永久に受信する myled = 1; // NUCLEOのLEDをHレベル(3.3V)へ xbee_gpo(dev_gpio,11,1); // GPOポート11をHレベル(3.3V)へ