Wireless communication 2 arduinos

Hello,
I have 2 arduino's, 0018 version. The transmitting arduino is running some test code that is sending commands out through a Hope rf transceiver. The receiving arduino is getting the commands through a second Hope rf transceiver.
Can't remember were I found this receive end code. It works great decoding the commands directly from the serial monitor, Does not work at all when using the wireless transceivers.
Can someone tell me why this will not work over wireless? Thanks

"Transmitter"
*/
#define LineEnd '#'
void setup() {
Serial.begin(9600);
}

void loop() {
// read the analog input into a variable:

// print the result:
Serial.println("BR40#");
// wait 10 milliseconds for the analog-to-digital converter
// to settle after the last reading:
delay(3000);
Serial.println("BF40#");
delay(3000);
Serial.println("S140#");
delay(3000);
Serial.println("S199#");
delay(3000);

"Receiver"
#include <Servo.h>

#define PwmPinMotorA 3 // this has been moved from pin 11 on the original Ardumoto
#define PwmPinMotorB 11
#define DirectionPinMotorA 12
#define DirectionPinMotorB 13
#define SerialSpeed 9600
#define BufferLength 16
#define LineEnd '#'
#define PinServo1 7
#define PinServo2 8
#define PinServo3 9
#define DefaultServoPosition 90

Servo servo1;
Servo servo2;
Servo servo3;
char inputBuffer[BufferLength];

void setup()
{
// motor and servo pins must be outputs
pinMode(PwmPinMotorA, OUTPUT);
pinMode(PwmPinMotorB, OUTPUT);
pinMode(DirectionPinMotorA, OUTPUT);
pinMode(DirectionPinMotorB, OUTPUT);
pinMode(PinServo1, OUTPUT);
pinMode(PinServo2, OUTPUT);
pinMode(PinServo3, OUTPUT);
// attach servos and set servo-specific timing details
servo1.attach(PinServo1, 600, 2100); // Tower Pro SG90 servo
servo2.attach(PinServo2, 700, 2300); // Sanwa SRM-102 servo
servo3.attach(PinServo3, 600, 2100); // Tower Pro SG90 servo
// default servo positions
servo1.write(DefaultServoPosition);
servo2.write(DefaultServoPosition);
servo3.write(DefaultServoPosition);

Serial.begin(SerialSpeed);
}

// process a command string
void HandleCommand(char* input, int length)
{
Serial.println(input);
if (length < 2) { // not a valid command
return;
}
int value = 0;
// calculate number following command
if (length > 2) {
value = atoi(&input[2]);
}
int* command = (int*)input;
// check commands
// note that the two bytes are swapped, ie 'RA' means command AR
switch(*command) {
case 'FA':
// motor A forwards
analogWrite(PwmPinMotorA, value);
digitalWrite(DirectionPinMotorA, HIGH);
break;
case 'RA':
// motor A reverse
analogWrite(PwmPinMotorA, value);
digitalWrite(DirectionPinMotorA, LOW);
break;
case 'FB':
// motor B forwards
analogWrite(PwmPinMotorB, value);
digitalWrite(DirectionPinMotorB, LOW);
break;
case 'RB':
// motor B reverse
analogWrite(PwmPinMotorB, value);
digitalWrite(DirectionPinMotorB, HIGH);
break;
case '1S':
// servo1
servo1.write(value);
break;
case '2S':
// servo2
servo2.write(value);
break;
case '3S':
// servo 3
servo3.write(value);
break;
default:
Serial.println("unknown command");
break;
}
}

void loop()
{
// get a command string form the serial port
int inputLength = 0;
do {
while (!Serial.available()); // wait for input
inputBuffer[inputLength] = Serial.read(); // read it in
} while (inputBuffer[inputLength] != LineEnd && ++inputLength < BufferLength);
inputBuffer[inputLength] = 0; // add null terminator
HandleCommand(inputBuffer, inputLength);
}

One more thing, When serial monitor is connected to receiving arduino I can see data being received over wireless from the the transmitting arduino. BF40, BR40, They are missing the line end # character though.

Have a look at the documentation and code at MilesBurton.com

One more thing, When serial monitor is connected to receiving arduino I can see data being received over wireless from the the transmitting arduino. BF40, BR40, They are missing the line end # character though.

do {
   while (!Serial.available()); // wait for input
   inputBuffer[inputLength] = Serial.read(); // read it in
 } while (inputBuffer[inputLength] != LineEnd && ++inputLength < BufferLength);
 inputBuffer[inputLength] = 0; //  add null terminator

This code waits for a character to be available to read. When a character is available, it is read, and stored in the buffer. When the last character in the buffer IS the LineEnd character, the while loop ends, and the LineEnd character is replaced by a NULL.

That ++ preceding inputLength in the while clause is in the wrong place.

 case 'FA':

This case will never be met. The value in the parentheses on the switch statement is the address of an array. While that is a constant, and, therefore valid, it is not what you want.

'FA' is not a valid value for a character, either. 'F' is, or 'A' is, but not 'FA'.

If you want to do something based on the first two letters input, you will need to use a series of if statements, not switch, and use strncmp to compare the string to the value desired.

As far as The "FA" case issue mentioned, I'm not sure I understand, This setup works fine over wire, Just not over wireless, I am fairly sure that the tranceivers are working properly, I had just used them to display analog values to an lcd over wireless.

If the switch clause is an int, the case statements should all involve ints:

int someInt = 14;
switch(someInt)
{
   case [glow]1[/glow]:
      // Do something
      break;
   // Other cases...
}

If the switch clause is a character, the case statements should all involve chars:

char someChar = 'A';
switch(someChar)
{
   case [glow]'A'[/glow]:
      // Do something
      break;
   // Other cases...
}

[/code]

'FA' (Note the single quotes) is NOT a character (at least not a valid character).

You look like you are trying to compare the first two characters of a string using case statements. That will not work. Period.