So looking from my title, my project seems very simple, but I have a very peculiar problem.
First off I have an Arduino UNO connected to an XBee Pro S1 through a Sparkfun XBee shield. I have configured the XBee to communicate with a coordinator XBee of the same model (configured as a coordinator using XCTU and in API mode) on the Sparkfun XBee Explorer dongle. My problem is that every time data is sent over serial from the Arduino-connected XBee I get somewhat ordered random characters before and after each transmission.
My code on the Arduino is:
int data[7];
void setup()
{
//Create Serial Object (57600 Baud)
Serial.begin(57600);
//initialize all data values
data[0] = 1261;
for(int i = 1; i < 7; i++)
data[i]=0;
}
void loop()
{
//delay for 1Hz
delay(1000);
//loop for test incrementing of dummy values
for(int i=1; i<7; i++)
{
data[i]++;
}
//declare toSend String
String toSend;
//loop for displaying values
for(int j=0; j<7; j++)
{
String toConcat = String(data[j]);
toSend = toSend + toConcat + ",";
}
//endl at last element of array
Serial.println(toSend);
}
My output for the first couple seconds through the XBee connected to the explorer is:
y~ T 1261,1,1,1,1,1,1,
ï~ S 1261,2,2,2,2,2,2,
ê~ S 1261,3,3,3,3,3,3,
ä~ S 1261,4,4,4,4,4,4,
Any help would be appreciated.