Controlling an LR4 board using Arduino

Im having trouble getting the LR4 board by porcupine labs to work with Arduino. I have tried the code found in this thread nothing worked. the way we have it set up is we cut open a mini USB cable and used the Red and Black wires to power the LR4 and 414D through the Arduinos, We then used the white and green wires for Tx and Rx the diagram below shows our setup. SO we have the Arduino connected to the LR4 through its USB port.


Here is the sample code that I was able to get from Porcupine labs forum website:
#include SoftwareSerial

SoftwareSerial mySerial(2, 3); // TX, RX

char measureBuf[6]; // enough space for five digits plus a zero byte
int offset;

void setup()
{
Serial.begin(9600);
mySerial.begin(9600);
while (!Serial); // Wait untilSerial is ready (for Leonardo)
mySerial.print(“g”); // tell the LR4 to go
offset = 0;
}

void loop()
{
if (mySerial.available()) {
char ch = mySerial.read();

if (ch == ‘\r’) {
measureBuf[offset] = ‘\0’; // measureBuf now contains a string like “12345”
//ProcessMeasurement(measureBuf); // do something with measureBuf

for(int x; x<5;x++){
Serial.print(measureBuf);
if(x>5){Serial.println(measureBuf);};
};
offset = 0;
}

if (ch == ‘\n’)
offset = 0; // nothing to do, set offset to zero just to be safe

if (offset < 5)
measureBuf[offset++] = ch;
}
}

#include 

SoftwareSerial mySerial(2, 3); // TX, RX


char measureBuf[6]; // enough space for five digits plus a zero byte
int offset;

void setup()
{
Serial.begin(9600);
mySerial.begin(9600);
while (!Serial); // Wait untilSerial is ready (for Leonardo)
mySerial.print("g"); // tell the LR4 to go
offset = 0;
}

void loop()
{
if (mySerial.available()) {
char ch = mySerial.read();

if (ch == '\r') {
measureBuf[offset] = '\0'; // measureBuf now contains a string like "12345"
//ProcessMeasurement(measureBuf); // do something with measureBuf

for(int x; x<5;x++){
Serial.print(measureBuf[x]);
if(x>5){Serial.println(measureBuf[x]);};
};
offset = 0;
}

if (ch == '\n')
offset = 0; // nothing to do, set offset to zero just to be safe

if (offset < 5)
measureBuf[offset++] = ch;
}
}