首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >pc中的Xbee explorer与arduino中的Xbee通信

pc中的Xbee explorer与arduino中的Xbee通信
EN

Stack Overflow用户
提问于 2015-04-27 23:10:33
回答 1查看 885关注 0票数 1

我在pc上有一个Xbee浏览器,还有一个带有arduino无线屏蔽的arduino,还有另一个Xbee。使用XCTU我可以从arduino接收数据到PC,但不能反过来接收数据,使用XCTU将数据发送到arduino。如果我从XCTU发送,只有来自arduino无线屏蔽的led RSSI是打开的,但它应该是RX led。

这是我在arduino上使用的代码,展位天线是S1 Xbee天线,天线都是默认值恢复

代码语言:javascript
运行
复制
// We'll use SoftwareSerial to communicate with the XBee:
#include <SoftwareSerial.h>

SoftwareSerial XBee(10,11); // RX, TX

void setup()
{
  // Set up both ports at 9600 baud. This value is most important
  // for the XBee. Make sure the baud rate matches the config
  // setting of your XBee.
  XBee.begin(9600);
  Serial.begin(9600);
}

void loop()
{
  if (Serial.available())
  { // If data comes in from serial monitor, send it out to XBee
    Serial.println("first if");
    XBee.write(Serial.read());
  }

  if (XBee.available())
  { // If data comes in from XBee, send it out to serial monitor
    Serial.println("second if");
    Serial.write(XBee.read());
  }
}
EN

回答 1

Stack Overflow用户

发布于 2021-10-21 08:56:49

请精确地确定您的两个xbee模块的操作模式(使用XBEE3时可能很难通信),以及它们的DL、DH

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29899479

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档