OK.
I really want to solve the problem so i followed the instruction here Xbee Adapter - Connecting, Configuring and Upgrading and i use parallel Desktop on my MAC to configure the 2 Xbee.
I didn't use X-CTU but the HyperTerminal. I have access to the 2 Xbee (YES !!) and +++ gives OK, etc ...
I realized that the 2 Xbee had the same ID (3332), I changed one in 3333, and ATWR to write it.
I double cheked if the new ID were 3333, and it is.
So, happy with this first contact with Xbee, I started again with my 2 circuits to make them talk.
In the First Board i loaded this code (found here > Communication / Physical Pixel ) (and I just added few lines of Digitals / BlinkwithoutDelay to have a led that shows me that the board is working) =
const int ledPin = 13; // the pin that the LED is attached to
int incomingByte; // a variable to read incoming serial data into
// Variables will change:
int ledState = LOW; // ledState used to set the LED
long previousMillis = 0; // will store last time LED was updated
// the follow variables is a long because the time, measured in miliseconds,
// will quickly become a bigger number than can be stored in an int.
long interval = 1000; // interval at which to blink (milliseconds)
void setup() {
// initialize serial communication:
Serial.begin(9600);
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
pinMode(6, OUTPUT);
}
void loop() {
//CODE FOR BLINK ACTIVITY
unsigned long currentMillis = millis();
if(currentMillis - previousMillis > interval) {
// save the last time you blinked the LED
previousMillis = currentMillis;
// if the LED is off turn it on and vice-versa:
if (ledState == LOW)
ledState = HIGH;
else
ledState = LOW;
// set the LED with the ledState of the variable:
digitalWrite(6, ledState);
}
//CODE FOR COMMUNICATION
// see if there's incoming serial data:
if (Serial.available() > 0) {
// 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);
}
}
}
For sure, i have a led in pin 13 (and an other in pin 6)
The board is doing the job. My LED on 6 blinks, and the one on 13 goes ON if i write H in the serial Monitor, and OFF if i write L.
The Second one.
i loaded this code =
void setup()
{
pinMode(13, OUTPUT);
Serial.begin(9600);
}
void loop()
{
Serial.print('H');
digitalWrite(13, HIGH);
delay(1000);
Serial.print('L');
digitalWrite(13, LOW);
delay(1000);
}
I use a LED on 13 just to see the activity.
the code is loaded and work good.
Both Xbee Shield are in UART mode on there switchs.
I unplugged the USB cables and use the external Power ... the 2 boards blinks, there's activity, but no communication, the LED on 13 on the First one don't blink.
Did i miss something ???
I am lost ...