“(SKU:RB-03T035)XBee Pro 60mW通信模塊(無天線)”的版本間的差異

來自ALSROBOT WiKi
跳轉(zhuǎn)至: 導(dǎo)航、 搜索
?規(guī)格參數(shù)
第12行: 第12行:
  
 
==應(yīng)用例程==
 
==應(yīng)用例程==
?
XBee與Arduino相關(guān)連接應(yīng)用
+
===示例代碼===
?
[[文件:RB-03T0331.png|500px|縮略圖|居中]]
+
<pre style='color:blue'>void setup() {
 +
  Serial.begin(9600);    //initialize serial
 +
  pinMode(13, OUTPUT);  //set pin 13 as output
 +
}
  
?
[[文件:RB-03T0332.png|500px|縮略圖|居中]]
+
void loop() {
?
[[文件:RB-03T0333.png|500px|縮略圖|居中]]
+
  while(Serial.available()){  //is there anything to read?
?
[[文件:RB-03T0334.png|500px|縮略圖|居中]]
+
char getData = Serial.read();  //if yes, read it
?
[[文件:RB-03T0335.png|500px|縮略圖|居中]]
+
 
 +
if(getData == 'a'){ 
 +
    digitalWrite(13, HIGH);
 +
}else if(getData == 'b'){
 +
    digitalWrite(13, LOW);
 +
}
 +
  }
 +
}</pre>
 +
===程序效果===
 +
監(jiān)控串口是否有數(shù)據(jù)可用,“a”打開引腳13上的LED“b”將其關(guān)閉。
 
==產(chǎn)品相關(guān)推薦==
 
==產(chǎn)品相關(guān)推薦==
?
購買地址:[http://gharee.com/goods-495.html XBee Pro 60mW通信模塊(無天線)]
+
購買地址:[http://gharee.com/goods-495.html XBee Pro 60mW通信模塊(無天線)]<br />
 +
 
 +
相關(guān)資料1:[http://www.sparkfun.com/datasheets/Wireless/Zigbee/XBee-Datasheet.pdf 數(shù)據(jù)表]<br />
 +
 
 +
相關(guān)資料2:[https://www.sparkfun.com/datasheets/Wireless/Zigbee/XBee-Manual.pdf 產(chǎn)品手冊]<br />
 +
 
 +
相關(guān)資料3:[https://www.sparkfun.com/datasheets/Wireless/Zigbee/XBee-Dimensional.pdf 尺寸圖]<br />
 +
 
 +
相關(guān)資料4:[http://bildr.org/2011/04/arduino-xbee-wireless/ bildr教程]

2015年6月12日 (五) 15:24的版本

RB-03T035.jpg

目錄

產(chǎn)品概述

此款無線通信模塊為美國電子巨頭Sparkfun Electronic原裝進口產(chǎn)品。易于使用,功耗極低,可提供設(shè)備間關(guān)鍵數(shù)據(jù)的可靠傳輸。由于設(shè)計上的創(chuàng)新,XBee-PRO在范圍上可以超越標(biāo)準(zhǔn)ZigBee模塊2-3倍,并且建立RF通信不需要任何配置。

規(guī)格參數(shù)

  1. 3.3V@215mA
  2. 最大數(shù)據(jù)傳輸速率250kbps
  3. 工作范圍1500米
  4. 內(nèi)置天線
  5. 通過FCC(Federal Commanications Commission)認(rèn)證
  6. IEEE 802.15.4網(wǎng)絡(luò)協(xié)議
  7. 128位加密

應(yīng)用例程

示例代碼

void setup() {
  Serial.begin(9600);    	//initialize serial
  pinMode(13, OUTPUT);   	//set pin 13 as output
}

void loop() {
  while(Serial.available()){  //is there anything to read?
	char getData = Serial.read();  //if yes, read it

	if(getData == 'a'){  	 
  	  digitalWrite(13, HIGH);
	}else if(getData == 'b'){
  	  digitalWrite(13, LOW);
	}
  }
}

程序效果

監(jiān)控串口是否有數(shù)據(jù)可用,“a”打開引腳13上的LED“b”將其關(guān)閉。

產(chǎn)品相關(guān)推薦

購買地址:XBee Pro 60mW通信模塊(無天線)

相關(guān)資料1:數(shù)據(jù)表

相關(guān)資料2:產(chǎn)品手冊

相關(guān)資料3:尺寸圖

相關(guān)資料4:bildr教程