Bees shield

概述

Bees shield是DFRobot出品的一款Arduino兼容的xbee插座扩展板。 Bees shield拥有双xbee接口,能够很好地适应两种不同的xbee模块,是您连接通信设备非常重要的伙伴。第二串口使用软串口通信,避免占用了主串口,可直接堆叠到其他Arduino扩展板上。不用担心串口被占用。

技术规格

端口定义

警告:下载程序时一定要将RUN/PROG开关拨到PROG端. 不然Xbee将会占用串口,导致下载失败

编号5中,丝印代表的管脚为Xbee模块的TXRX,并非Arduino代码中定义软串口的TX/RX。跳帽的连接方式需要和代码中定义的TX/RX引脚号相反:代码中定义的是软串口的 RX 和 TX,这边跳帽插的应该是xbee模块的 TX 和 RX,详情请见下面的使用教程,注意跳帽位置与代码中 TX,RX 的管脚区别。

模块使用教程

这个教程将会用两块 BLE Link(蓝牙无线通信模块)作为例子。

准备

注意:下载程序的时候将Xbbs shield PROG/RUN开关拨到PROG一端

Bee1使用硬件串口 Bee2使用软串口

硬件连接图

DFR0210-CON1.png

样例代码
/*
 # This sample code is used to test the Bees shield.
 # Editor : Mickey
 # Ver    : 1.0
 # Product: Bees shield
 # SKU    : DFR0210
 # The circuit:
   software RX is digital pin 2 (connect to TX of Bee2 device)
   software TX is digital pin 3 (connect to RX of Bee2 device)
*/

#include <SoftwareSerial.h>

SoftwareSerial mySerial(2, 3); // UNO RX -- Bee TX, UNO TX -- Bee RX

void setup()
{
  Serial.begin(115200);
  mySerial.begin(115200);
  delay(50);

}
void loop()
{
  Serial.println("this is Bee1 hardware!");
  mySerial.println("this is Bee2 software!");
  delay(500);
}
结果

Bee1_result.jpg Bee2_result.jpg

Bee2使用硬件串口,Bee1使用软串口

硬件连接图

DFR0210-CON.png

样例代码
    /*
     # This sample code is used to test the Bees shield.
     # Editor : Mickey
     # Ver    : 1.0
     # Product: Bees shield
     # SKU    : DFR0210
     # The circuit:
       software RX is digital pin 2 (connect to TX of Bee1 device)
       software TX is digital pin 3 (connect to RX of Bee1 device)
    */

    #include <SoftwareSerial.h>

    SoftwareSerial mySerial(2, 3); // UNO RX -- Bee TX, UNO TX -- Bee RX

    void setup()
    {
      Serial.begin(115200);
      mySerial.begin(115200);
      delay(50);

    }
    void loop()
    {
      Serial.println("this is Bee2 hardware!");
      mySerial.println("this is Bee1 software!");
      delay(500);
    }
结果

Bees1_result.jpg Bees2_result.jpg

切换两个硬件串口输出

硬件连接图

EN跳线控制硬串口切换脚,下方的软串口选择跳线不工作

DFR0210-CON2.png

样例代码
/*
 # This sample code is used to test A Arduino hardware serial switch.
 # Editor : Mickey
 # Ver    : 1.0
 # Product: Bees shield
 # SKU    : DFR0210
*/

void setup()
{
  Serial.begin(115200);
  pinMode(4, OUTPUT);
  delay(500);
}
void loop()
{
  digitalWrite(4, LOW);
  Serial.println("this is Bee1 hardware!");
  Serial.println(" ");
  delay(500);

  digitalWrite(4, HIGH);
  Serial.println("this is Bee2 hardware!");
  Serial.println(" ");
  delay(500);
}
结果

Bees1_result.jpg Bees2_result.jpg

注意

Bees Shield只支持以上三种模式的设置,不能将两个都设置成软串口!

相关文档

常见问题

还没有客户对此产品有任何问题,欢迎通过qq或者论坛联系我们!

更多问题及有趣的应用,可以 访问论坛 进行查阅或发帖!

更多

DFshopping_car1.png DFRobot商城购买链接