hey guys, i recently started working with arduino and xbees, I am trying to make my xbee pro s2 on a shield turn another xbee pro s2 on another shield on and off. Both xbees are on separate arduino board. here is the code i have written so far but it doesn't do anything.
thanks for the help in advance
Here is my current code for the sender arduino.
const int buttonPin = 2;
void setup()
{
Serial.begin(9600);
pinMode(buttonPin, INPUT);
}
void loop()
{
digitalRead(buttonPin == 'H') ;
delay(100);
digitalRead(buttonPin == 'L');
delay(100);
}
here is my code for the receiving arduino:
const int ledPin = 13;
int incoming;
void setup()
{
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
Serial.print("start on S");
}
void loop()
{
if(Serial.available() > 0);
{
incoming = Serial.read();
if(incoming == 'H') {
digitalWrite(ledPin, HIGH);
}
if( incoming == 'L') {
digitalWrite(ledPin, LOW);
}
}
}