First post on this forum
I have followed a simple example on arduino's forum to light a led when pushing a button. It work well. I have included in this program a message to send via Xbee modules to test my connection When I plug on my Arduino the Xbee module (standard S2) using funduino xshield, after few seconds the program fails, the led doesn't light when pushing the button. If I reset, it works untils xBee initialization it completed and then not work.
Is it a pb of hardware compatibility ? should I change my shield ?
Here's my program :
int LED=12;
int BUTTON=4;
#include <SoftwareSerial.h>
SoftwareSerial XBee(2, 3); // RX, TX
void setup() {
XBee.begin(9600);
Serial.begin(9600);
pinMode(LED,OUTPUT);
pinMode(BUTTON,INPUT);
}
void loop() {
if(digitalRead(BUTTON) == HIGH)
{
digitalWrite(LED,HIGH);
XBee.write ("ON");
} else {
digitalWrite(LED,LOW);
XBee.write ("OFF");
}
}
thks for your help I