Glitches in Receiving Incoming Accelerometer Data sending from Lilypad Xbee

Hi all,

First time posting, any help would be greatly appreciated. My setup is as follows:

Accelerometer data is being read by Lilypad Arduino (will post code below). The Arduino is sending the data to a Lilypad Xbee breakout board on its rx port, and its transmitting to an Xbee explorer attached to my computer. I'm using the data in Supercollider for triggering, but I've been troubleshooting in CoolTerm. Any rapid movements causes data to either stop coming in entirely, or to start coming in in a glitchy, uncontrolled way. I'm still receiving the data in the correct format (i.e. "x: 536 / y: 440 / z: 579") when it comes in, but it either stops being received entirely or else starts being received in spurts of information followed by nothing. I've tried bypassing the Lilypad Xbee and checking the incoming data from the accelerometer while plugged into the main Lilypad, and that is still working fine, so the problem is somewhere with the breakout board or the connections between the main Arduino and the breakout board. The connections are:
Lilypad Xbee Lilypad

  • 3.3V

Pin 6 rx

  • and - connected to 9V

I've tried using alligator clips rather than conductive thread, and it doesn't seem to solve the problem. I also resewed the entire circuit to make sure it wasn't a problem with crossed thread, and that didn't help anything. I have no idea what's wrong - any help would be awesome. Thanks so much.

Arduino code:

// Lilypad Accelerometer
#include <SoftwareSerial.h>

#define rxPin 5
#define txPin 6
#define ledPin 13

SoftwareSerial mySerial = SoftwareSerial(rxPin, txPin);
byte pinState = 0;

int sensorValueX;
int acceleroX = A2;
int sensorValueY;
int acceleroY = A3;
int sensorValueZ;
int acceleroZ = A4;

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

void loop() {
//char someChar = mySerial.read();
// print out the character:
sensorValueX = analogRead(acceleroX);
mySerial.print("x:");
mySerial.println(sensorValueX);
delay(10);
sensorValueY = analogRead(acceleroY);
mySerial.print("y:");
mySerial.println(sensorValueY);
delay(10);
sensorValueZ = analogRead(acceleroZ);
mySerial.print("z:"); // read accelereometer data
mySerial.println(sensorValueZ);
delay(10);

}

//

thanks,
dylan