Go Down

Topic: Lilypad Simple to Xbee Shield (Read 2250 times) previous topic - next topic

gtfrap

Okay, so I wanna know how to connect a Lilypad arduino simple board, to an xbee shield so I can send serial data from my computer (which is connected to an xbee on an xbee explorer board) to my arduino, and vice-versa.

Lilypad Simple: https://www.sparkfun.com/products/10274
Xbee shield: https://www.sparkfun.com/products/9841?

So far I have it hooked up like this, not sure if its correct though:

Arduino      Shield
    +            3.3V
    -             GND
    5(TX)       RX
    6 (RX)      TX

Then this is the code im trying to use.

Code: [Select]

#include <SoftwareSerial.h>

#define rxPin 6
#define txPin 5


SoftwareSerial mySerial =  SoftwareSerial(rxPin, txPin);

void setup()  {
  pinMode(rxPin, INPUT);
  pinMode(txPin, OUTPUT);
  mySerial.begin(9600);
}

void loop()
{
  mySerial.print('H');
  delay(1000);
  mySerial.print('L');
  delay(1000);
}
             

If anyone is able to help it'd be much appreciated!

Go Up