Sunday, 27 March 2011

Arduino speaks XBEE

This is my first "Hello World" with Arduino and XBEE.


All XBEE's are set up as:
ATBD6
ATMY0
ATDL0
ATDH0
ATID3332 (this is the default setting)

On one Arduino-FIO there is the next sketch:

void setup() {
  Serial.begin(57600);
   delay(1000);

}

void loop() {
  Serial.println("Som la gent blaugrana");
  delay(5000);
}

And the other Arduino-FIO node has this sketch:

void setup() {
  // configurar ports
  Serial.begin(57600);
  // configurar XBEE periferic
  // setDestination();

  delay(1000);

}

void loop() {
  Serial.print(millis(),DEC);
  Serial.print("tant se val d'on venim");
  while (Serial.available() > 0) {
  
    byte b = Serial.read();
    Serial.print(b);
  }
 
  delay(5000);
}

No comments:

Post a Comment