4

Xbee モジュールを使用するのは初めてです。2 つの Xbee モジュール Serie 1 を使用しています。

それらは次のようにプログラムされています。

CH 10 ID 1 DH 0 DL 3 マイ 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);
   }
}

そのため、xbee シールドを使用して arduino にエンド デバイスを配置し、xbee エクスプローラーにコーディネーターを配置しました。X-CTUソフトを使って、コーディネーターで書いているのですが、何も起こりません。

4

1 に答える 1