这是我第一次使用 Xbee 模块。我正在使用两个 Xbee 模块 Serie 1。
它们的编程如下:
CH 10 ID 1 DH 0 DL 3 MY 2 CE 0
和
CH 10 ID 1 DH 0 DL 2 MY 3 CE 1
Arduino 正在运行这个:
const int ledPin = 13; // the pin that the LED is attached to
int incomingByte; // a variable to read incoming serial data into
void setup() {
// initialize serial communication:
Serial.begin(9600);
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
}
void loop() {
// read the oldest byte in the serial buffer:
incomingByte = Serial.read();
// if it's a capital H (ASCII 72), turn on the LED:
if (incomingByte == 'H') {
digitalWrite(ledPin, HIGH);
}
// if it's an L (ASCII 76) turn off the LED:
if (incomingByte == 'L') {
digitalWrite(ledPin, LOW);
}
}
所以,我把终端设备放在 arduino 上,使用 xbee shield,协调器放在 xbee explorer 上。使用 X-CTU 软件,我正在编写协调器,但没有任何反应。