Need help transmitting 2x thumbstick data [Solved] Thanks PaulS

Thanks for reading this.
The equipment i have
2x Arduinos
2x Nrf24L01+PA,LNA with 2DB atenna
2x Thumbsticks
1x Motordriver L298n brick
1x Standard hobby servo

I have read just about every post in arduino forum and i could find with google on Nrf24l01+'s and tho useful i could not seem to transmit more than one reading from one pot on one stick at a time ( not verry handy me thinks). I have been trying transmitting strings, messageing systems and others. i have to be honist my prograqming skills are lacking a bit so i need all the help i can get i guess. to be honist i have been toying with the for about 4 months and just get so frustrated with trying to combine the pot values and transmit the data that i just walk away till i think ( Oh i wonder if…) and well let’s just say i would not be posting if i had a sucess :). anywho i like Mirf it seems simple to use so i hope i can keep using it. Welp there is my request i hope i have added all the info i need. i know it is going to be somthing simple but i am just to burnt to keep trying its boarderline pathetic by now LOL. We agine thanks for reading and hope i get some guidence

i could not seem to transmit more than one reading from one pot on one stick at a time ( not verry handy me thinks)

The problem would seem to be your code, then.

to be honist i have been toying with the for about 4 months and just get so frustrated with trying to combine the pot values and transmit the data that i just walk away till i think ( Oh i wonder if....) and

No matter how embarrassing, you have to show us [u]some[/u] code.

I know it is sad bu you did ask for it. me think it’s geting mashed up in Mirf.getdata or maby i can “point?” (sent) to each val1-4 in series? dunno guess that’s why im here.

Transmitter

#include <Mirf.h>
#include <MirfHardwareSpiDriver.h>
#include <MirfSpiDriver.h>
#include <nRF24L01.h>
#include <SPI.h>

int pot1pinX = 0;  // analog pin used for the pot 1
int pot1pinY = 1;  // analog pin used for the pot 1
int pot2pinX = 2;  // analog pin used for the pot 2
int pot2pinY = 3;  // analog pin used for the pot 2

int val1;    
int val2;
int val3;
int val4;

void setup(){
  Serial.begin(9600);
  Mirf.csnPin = 9;
  Mirf.cePin = 8;
  Mirf.spi = &MirfHardwareSpi;
  Mirf.init();
  Mirf.setRADDR((byte *)"clie1");
  Mirf.payload = sizeof(long);
  Mirf.config();
  Serial.println("Beginning ... ");
}
void loop(){
    val1 = analogRead(pot1pinX);		
    val2 = analogRead(pot1pinY);		
    val3 = analogRead(pot2pinX);		
    val4 = analogRead(pot2pinY);		
      val1 = map(val1, 0, 1023, 0, 179);    
      val2 = map(val2, 0, 1023, 0, 179);
      val3 = map(val3, 0, 1023, 0, 179);
      val4 = map(val4, 0, 1023, 0, 179);

  unsigned long time = millis();
  long time_long = long(time);
  Mirf.setTADDR((byte *)"serv1");
  Mirf.send((byte *)&val1);
  Mirf.send((byte *)&val2);
  Mirf.send((byte *)&val3);
  Mirf.send((byte *)&val4);

//    Serial.println(val1);
//    Serial.println(val2);
//    Serial.println(val3);
//    Serial.println(val4);
  while(Mirf.isSending()){
  }
  delay(10);
}

Reciever

#include <Mirf.h>
#include <MirfHardwareSpiDriver.h>
#include <MirfSpiDriver.h>
#include <nRF24L01.h>
#include <SPI.h>
#include <Servo.h>

byte sent;
Servo myservo1;  
Servo myservo2;
Servo myservo3;
Servo myservo4;

int val;    
int val1;    
int val2;
int val3;
int val4;

void setup(){
  Serial.begin(9600);
  myservo1.attach(5);  
  myservo2.attach(6); 
  myservo3.attach(3); 
  myservo4.attach(11); 
    Mirf.csnPin = 9;
    Mirf.cePin = 8;
    Mirf.spi = &MirfHardwareSpi;
    Mirf.init();
    Mirf.setRADDR((byte *)"serv1");
    Mirf.payload = sizeof(long);
    Mirf.config();
  Serial.println("Beginning...");
}
void loop(){
  byte data[Mirf.payload];
  if(Mirf.dataReady()){
    do{
	Mirf.getData(&sent);
	long time_long = long(data);
            val1 = int(sent);
            val2 = int(sent);
            val3 = int(sent);
            val4 = int(sent);
            Serial.print("Val1: ");
            Serial.println(val1);  
            Serial.print("Val2: ");
            Serial.println(val2);  
            Serial.print("Val3: ");
            Serial.println(val3);
            Serial.print("Val4: ");
            Serial.println(val4);  
  
  
  myservo1.write(val1);			
  myservo2.write(val2);
  myservo3.write(val3);
  myservo4.write(val4);

  delay(15);	

    }while(!Mirf.rxFifoEmpty());
  }
}

i added a nother servo on the rec end pins 5,6 have them now. i could put the other two on if you think it would help.
thanks for looking PaulS.

  Mirf.payload = sizeof(long);

So, here you are defining how much data can be in one transmission. If you were to set this value larger, you could shoe-horn more data in one transmission.

http://www.arduino.cc/playground/InterfacingWithHardware/Nrf24L01

void send(byte *data) Send data. 'data' should be Mirf.payload bytes long.

So, if you want to send 4 bytes:

  Mirf.payload = 4 * sizeof(byte);
  byte vals[4];
  vals[0] = val1;
  vals[1] = val2;
  vals[2] = val3;
  vals[3] = val4;
  Mirf.setTADDR((byte *)"serv1");
  Mirf.send(vals);

You need to make similar changes to the receiver.

Ok so far seems good ( how do i print vals after it has been sent to make sure it has the values of the pots? serialprintln sont seem to like it. ( because it has become an array?)) thanks

Transmitter

#include <Mirf.h>
#include <MirfHardwareSpiDriver.h>
#include <MirfSpiDriver.h>
#include <nRF24L01.h>
#include <SPI.h>

int pot1pinX = 0;  // analog pin used for the pot 1
int pot1pinY = 1;  // analog pin used for the pot 1
int pot2pinX = 2;  // analog pin used for the pot 2
int pot2pinY = 3;  // analog pin used for the pot 2

int val0;    
int val1;
int val2;
int val3;

void setup(){
  Serial.begin(9600);
  Mirf.csnPin = 9;
  Mirf.cePin = 8;
  Mirf.spi = &MirfHardwareSpi;
  Mirf.init();
  Mirf.setRADDR((byte *)"clie1");
  Mirf.payload = 4 * sizeof(byte);
  Mirf.config();
  Serial.println("Beginning ... ");
}
void loop(){
  byte vals[4];
        vals[0] =val0;  
        vals[1] =val1;
        vals[2] =val2;
        vals[3] =val3;    
    val0 = analogRead(pot1pinX);		
    val1 = analogRead(pot1pinY);		
    val2 = analogRead(pot2pinX);		
    val3 = analogRead(pot2pinY);		
      val0 = map(val0, 0, 1023, 0, 179);    
      val1 = map(val1, 0, 1023, 0, 179);
      val2 = map(val2, 0, 1023, 0, 179);
      val3 = map(val3, 0, 1023, 0, 179);

 // unsigned long time = millis();
 // long time_long = long(time);
  Mirf.setTADDR((byte *)"serv1");
  Mirf.send(vals);
 // Serial.println(vals);
  while(Mirf.isSending()){
  }
  delay(10);
}

Reciever

#include <Mirf.h>
#include <MirfHardwareSpiDriver.h>
#include <MirfSpiDriver.h>
#include <nRF24L01.h>
#include <SPI.h>
#include <Servo.h>
byte vals;
//byte sent;
Servo myservo1;  
Servo myservo2;
//Servo myservo3;
//Servo myservo4;

int val0;    
int val1;
int val2;
int val3;

void setup(){
  Serial.begin(9600);
  myservo1.attach(5);  
  myservo2.attach(6); 
    Mirf.csnPin = 9;
    Mirf.cePin = 8;
    Mirf.spi = &MirfHardwareSpi;
    Mirf.init();
    Mirf.setRADDR((byte *)"serv1");
    Mirf.payload = 4 * sizeof(byte);
    Mirf.config();
  Serial.println("Beginning...");
}
void loop(){
  byte data[Mirf.payload];
  if(Mirf.dataReady()){
    do{
	Mirf.getData(&vals);
//        Mirf.getData(&sent);
      byte vals[4];
        vals[0] =val0;  
        vals[1] =val1;
        vals[2] =val2;
        vals[3] =val3;  
            Serial.print("Val0: ");
            Serial.println(val0);  
            Serial.print("Val1: ");
            Serial.println(val1);  
            Serial.print("Val2: ");
            Serial.println(val2);
            Serial.print("Val3: ");
            Serial.println(val3);  
  
  
  myservo1.write(val0);			
  myservo2.write(val1);
 // myservo3.write(val3);
 // myservo4.write(val4);

  delay(15);	

    }while(!Mirf.rxFifoEmpty());
  }
}

Seems to output 0’s in all the vals. or hav i completly misunderstood your comments?

        vals[0] =val0;  
        vals[1] =val1;
        vals[2] =val2;
        vals[3] =val3;    
    val0 = analogRead(pot1pinX);      
    val1 = analogRead(pot1pinY);      
    val2 = analogRead(pot2pinX);      
    val3 = analogRead(pot2pinY);      
      val0 = map(val0, 0, 1023, 0, 179);    
      val1 = map(val1, 0, 1023, 0, 179);
      val2 = map(val2, 0, 1023, 0, 179);
      val3 = map(val3, 0, 1023, 0, 179);

The array is not linked to the values you are storing in it. It would be better, therefore, to store the values in the array AFTER you read and map them. Don't you think?

You can print the values in the array, in a for loop.

Seems like it is storing them fine now. now i just need to “Read?” them on the reciever end correctly?

Transmitter:

#include <Mirf.h>
#include <MirfHardwareSpiDriver.h>
#include <MirfSpiDriver.h>
#include <nRF24L01.h>
#include <SPI.h>

int pot1pinX = 0;  // analog pin used for the pot 1
int pot1pinY = 1;  // analog pin used for the pot 1
int pot2pinX = 2;  // analog pin used for the pot 2
int pot2pinY = 3;  // analog pin used for the pot 2

int val0;    
int val1;
int val2;
int val3;

void setup(){
  Serial.begin(9600);
  Mirf.csnPin = 9;
  Mirf.cePin = 8;
  Mirf.spi = &MirfHardwareSpi;
  Mirf.init();
  Mirf.setRADDR((byte *)"clie1");
  Mirf.payload = 4 * sizeof(byte);
  Mirf.config();
  Serial.println("Beginning ... ");
}
void loop(){
    
    val0 = analogRead(pot1pinX);		
    val1 = analogRead(pot1pinY);		
    val2 = analogRead(pot2pinX);		
    val3 = analogRead(pot2pinY);		
      val0 = map(val0, 0, 1023, 0, 179);    
      val1 = map(val1, 0, 1023, 0, 179);
      val2 = map(val2, 0, 1023, 0, 179);
      val3 = map(val3, 0, 1023, 0, 179);
    byte vals[4];
        vals[0] =val0;  
        vals[1] =val1;
        vals[2] =val2;
        vals[3] =val3;  
 
 // unsigned long time = millis();
 // long time_long = long(time);
  Mirf.setTADDR((byte *)"serv1");
  Mirf.send(vals);
// Serial.println(vals);
  int i;
  for (i = 0; i < 3; i = i + 1) {
  Serial.println(vals[i], DEC);
}

  while(Mirf.isSending()){
  
  Serial.println("Sent packet");
  }
  delay(10);
}

I guess i just need to read them into an “array?” and use them now?
Rec:

#include <Mirf.h>
#include <MirfHardwareSpiDriver.h>
#include <MirfSpiDriver.h>
#include <nRF24L01.h>
#include <SPI.h>
byte vals;
//byte sent;

int val0;    
int val1;
int val2;
int val3;

void setup(){
  Serial.begin(9600);
    Mirf.csnPin = 9;
    Mirf.cePin = 8;
    Mirf.spi = &MirfHardwareSpi;
    Mirf.init();
    Mirf.setRADDR((byte *)"serv1");
    Mirf.payload = 4 * sizeof(byte);
    Mirf.config();
  Serial.println("Beginning...");
}
void loop(){
  byte data[Mirf.payload];
  if(Mirf.dataReady()){
    do{
	Mirf.getData(&vals);
//        Mirf.getData(&sent);

//      Serial.println(vals, DEC);

      byte vals[4];
        vals[0] =val0;  
        vals[1] =val1;
        vals[2] =val2;
        vals[3] =val3;  
int i;
  for (i = 0; i < 3; i = i + 1) {
  Serial.println(vals[i], DEC);
}          
           // Serial.print("Val0: ");
           // Serial.println(val0);  
           // Serial.print("Val1: ");
           // Serial.println(val1);  
           // Serial.print("Val2: ");
           // Serial.println(val2);
           // Serial.print("Val3: ");
           // Serial.println(val3);  
  
  delay(15);	

    }while(!Mirf.rxFifoEmpty());
  }
}

Seems to be working ish i get output on the Rec end now. gunna experiment a bit with the pots and ill report back.
agin thanks sooo much for this help

Somew wierd stuffs is going on one is the pot values are not maching on each ard. Trans will transmit like 80-90ish in center pot on all and the Rec is showing like 2 at 80-90 and 2 at 0 for some reason? also if i unremark the servo code the whol thing goes kaput i get 0’s on the reciever end.
Trans

#include <Mirf.h>
#include <MirfHardwareSpiDriver.h>
#include <MirfSpiDriver.h>
#include <nRF24L01.h>
#include <SPI.h>

int pot1pinX = 0;  // analog pin used for the pot 1
int pot1pinY = 1;  // analog pin used for the pot 1
int pot2pinX = 2;  // analog pin used for the pot 2
int pot2pinY = 3;  // analog pin used for the pot 2

int val0;    
int val1;
int val2;
int val3;

void setup(){
  Serial.begin(9600);
  Mirf.csnPin = 9;
  Mirf.cePin = 8;
  Mirf.spi = &MirfHardwareSpi;
  Mirf.init();
  Mirf.setRADDR((byte *)"clie1");
  Mirf.payload = 4 * sizeof(byte);
  Mirf.config();
  Serial.println("Beginning ... ");
}
void loop(){
    
    val0 = analogRead(pot1pinX);		
    val1 = analogRead(pot1pinY);		
    val2 = analogRead(pot2pinX);		
    val3 = analogRead(pot2pinY);		
      val0 = map(val0, 0, 1023, 0, 179);    
      val1 = map(val1, 0, 1023, 0, 179);
      val2 = map(val2, 0, 1023, 0, 179);
      val3 = map(val3, 0, 1023, 0, 179);
    byte vals[4];
        vals[0] =val0;  
        vals[1] =val1;
        vals[2] =val2;
        vals[3] =val3;  
 
  Mirf.setTADDR((byte *)"serv1");
  Mirf.send(vals);

  int i;
  for (i = 0; i < 4; i = i + 1) {
  Serial.println(vals[i], DEC);
 
}

  while(Mirf.isSending()){
  
  }
  delay(10);
}

Rec:

//#include <Servo.h>
#include <Mirf.h>
#include <MirfHardwareSpiDriver.h>
#include <MirfSpiDriver.h>
#include <nRF24L01.h>
#include <SPI.h>

byte vals;
//byte sent;
//Servo myservo0;  
//Servo myservo1;
//Servo myservo2;
//Servo myservo3;



int val0;    
int val1;
int val2;
int val3;

void setup(){
    Serial.begin(9600);
 // myservo0.attach(3);  
 // myservo1.attach(5); 
 // myservo2.attach(6);  
 // myservo3.attach(10); 

    Mirf.csnPin = 9;
    Mirf.cePin = 8;
    Mirf.spi = &MirfHardwareSpi;
    Mirf.init();
    Mirf.setRADDR((byte *)"serv1");
    Mirf.payload = 4 * sizeof(byte);
    Mirf.config();
  Serial.println("Beginning...");
}
void loop(){
  byte data[Mirf.payload];
  if(Mirf.dataReady()){
    do{
	Mirf.getData(&vals);

      byte vals[4];
        vals[0] =val0;  
        vals[1] =val1;
        vals[2] =val2;
        vals[3] =val3;  
int i;
  for (i = 0; i < 4; i = i + 1) {
  Serial.println(vals[i], DEC);
 
}          
         
  delay(10);	
    }while(!Mirf.rxFifoEmpty());
  }
//  myservo0.write(val0);			
 // myservo1.write(val1);
//  myservo2.write(val2);
//  myservo3.write(val3);

}

So two things. why are they not matching up and why does it fail when i activate the servo code? thanks for everything so far Paul

byte vals;

  byte data[Mirf.payload];
  if(Mirf.dataReady()){
    do{
    Mirf.getData(&vals);

      byte vals[4];

Global and local variables of the same name but different type are not a good thing.

You have declared an array to receive the data (called data). Yet, you try to read 4 bytes into a byte variable.

Then, you declare a local variable of the same name, copy a bunch of uninitialized (except that the compiler actually does initialize them) variables into that array, and print them out, and pretend that they are important.

Mirf.getData(data);

will get the data into the array that is sized to hold it. Then, val1, val2, val3, and val4 can be set to data[0], data[1], data[2], and data[3], respectively.

So two things. why are they not matching up and why does it fail when i activate the servo code?

Well, now you know the answer to the first part. The answer to the second part will need to wait until the first part is working.

so use “data” inplace of “vals” like this?
the array prints 0’s agin.

//#include <Servo.h>
#include <Mirf.h>
#include <MirfHardwareSpiDriver.h>
#include <MirfSpiDriver.h>
#include <nRF24L01.h>
#include <SPI.h>

//byte vals;
//byte sent;
//Servo myservo0;  
//Servo myservo1;
//Servo myservo2;
//Servo myservo3;



int val0;    
int val1;
int val2;
int val3;

void setup(){
    Serial.begin(9600);
 // myservo0.attach(3);  
 // myservo1.attach(5); 
 // myservo2.attach(6);  
 // myservo3.attach(10); 

    Mirf.csnPin = 9;
    Mirf.cePin = 8;
    Mirf.spi = &MirfHardwareSpi;
    Mirf.init();
    Mirf.setRADDR((byte *)"serv1");
    Mirf.payload = 4 * sizeof(byte);
    Mirf.config();
  Serial.println("Beginning...");
}
void loop(){
  byte data[Mirf.payload];
  if(Mirf.dataReady()){
    do{
	Mirf.getData(data);

      byte data[4];
        data[0] =val0;  
        data[1] =val1;
        data[2] =val2;
        data[3] =val3;  
int i;
  for (i = 0; i < 4; i = i + 1) {
  Serial.println(data[i], DEC);
 
}          
         
  delay(10);	
    }while(!Mirf.rxFifoEmpty());
  }
//  myservo0.write(val0);			
 // myservo1.write(val1);
//  myservo2.write(val2);
//  myservo3.write(val3);

}
  byte data[Mirf.payload];
  if(Mirf.dataReady()){
    do{
    Mirf.getData(data);

      byte data[4];
        data[0] =val0;  
        data[1] =val1;
        data[2] =val2;
        data[3] =val3;

No. First, you now have two arrays named data. The one that Mirf wrote to, and a new one.

Second, the values are in data[] and you want to assign it to other variables.

  byte data[Mirf.payload];
  if(Mirf.dataReady()){
    do{
    Mirf.getData(data);
        val1 = data[0];
        val2 = data[1];
        val3 = data[2];
        val4 = data[3];

Woot!.. ( all 4 servos now working (bit twitchy tho for osme reason)).
I see so the data comes in as an array already by defualt or is it becase we sent it as an array from the transmitter?

Transmitter:

#include <Mirf.h>
#include <MirfHardwareSpiDriver.h>
#include <MirfSpiDriver.h>
#include <nRF24L01.h>
#include <SPI.h>

int pot1pinX = 0;  // analog pin used for the pot 1
int pot1pinY = 1;  // analog pin used for the pot 1
int pot2pinX = 2;  // analog pin used for the pot 2
int pot2pinY = 3;  // analog pin used for the pot 2

int val0;    
int val1;
int val2;
int val3;

void setup(){
  Serial.begin(9600);
  Mirf.csnPin = 9;
  Mirf.cePin = 8;
  Mirf.spi = &MirfHardwareSpi;
  Mirf.init();
  Mirf.setRADDR((byte *)"clie1");
  Mirf.payload = 4 * sizeof(byte);
  Mirf.config();
  Serial.println("Beginning ... ");
}
void loop(){
    
    val0 = analogRead(pot1pinX);		
    val1 = analogRead(pot1pinY);		
    val2 = analogRead(pot2pinX);		
    val3 = analogRead(pot2pinY);		
      val0 = map(val0, 0, 1023, 0, 179);    
      val1 = map(val1, 0, 1023, 0, 179);
      val2 = map(val2, 0, 1023, 0, 179);
      val3 = map(val3, 0, 1023, 0, 179);
    byte vals[4];
        vals[0] =val0;  
        vals[1] =val1;
        vals[2] =val2;
        vals[3] =val3;  
 
  Mirf.setTADDR((byte *)"serv1");
  Mirf.send(vals);

  int i;
  for (i = 0; i < 4; i = i + 1) {
  Serial.println(vals[i], DEC);
 
}

  while(Mirf.isSending()){
  
  }
  delay(10);
}

Reciever

#include <Mirf.h>
#include <MirfHardwareSpiDriver.h>
#include <MirfSpiDriver.h>
#include <nRF24L01.h>
#include <SPI.h>

int pot1pinX = 0;  // analog pin used for the pot 1
int pot1pinY = 1;  // analog pin used for the pot 1
int pot2pinX = 2;  // analog pin used for the pot 2
int pot2pinY = 3;  // analog pin used for the pot 2

int val0;    
int val1;
int val2;
int val3;

void setup(){
  Serial.begin(9600);
  Mirf.csnPin = 9;
  Mirf.cePin = 8;
  Mirf.spi = &MirfHardwareSpi;
  Mirf.init();
  Mirf.setRADDR((byte *)"clie1");
  Mirf.payload = 4 * sizeof(byte);
  Mirf.config();
  Serial.println("Beginning ... ");
}
void loop(){
    
    val0 = analogRead(pot1pinX);		
    val1 = analogRead(pot1pinY);		
    val2 = analogRead(pot2pinX);		
    val3 = analogRead(pot2pinY);		
      val0 = map(val0, 0, 1023, 0, 179);    
      val1 = map(val1, 0, 1023, 0, 179);
      val2 = map(val2, 0, 1023, 0, 179);
      val3 = map(val3, 0, 1023, 0, 179);
    byte vals[4];
        vals[0] =val0;  
        vals[1] =val1;
        vals[2] =val2;
        vals[3] =val3;  
 
  Mirf.setTADDR((byte *)"serv1");
  Mirf.send(vals);

  int i;
  for (i = 0; i < 4; i = i + 1) {
  Serial.println(vals[i], DEC);
 
}

  while(Mirf.isSending()){
  
  }
  delay(10);
}

any ideas on how to setup a (center pot) nutral position ? say %5 or so?
thanks agin for all the help. i almost choked when i saw the # of posts you have nice job.

I see so the data comes in as an array already by defualt or is it becase we sent it as an array from the transmitter?

It comes in as an array because Wire.receive() is told to put the consecutive bytes it receives into an array.

any ideas on how to setup a (center pot) nutral position ?

You mean so that moving it one way shows positive values while moving it the other way shows negative values?

centerpot is so that when i touch the sticks they dont move servos/motors till i move it intentionaly. so like 89-91 seems to be middle (center) say dont move till it’s 82-99. >82 = up and < 99 = down etc.

Code so far.

#include <Mirf.h>
#include <MirfHardwareSpiDriver.h>
#include <MirfSpiDriver.h>
#include <nRF24L01.h>
#include <SPI.h>

//**************Start Pin Setup***************
int pot1pinX = 0;  // analog pin used for the pot 1
int pot2pinY = 1;  // analog pin used for the pot 2
//**************End Pin Setup***************

//**************Global vars Setup***************
int val0;    
int val1;
//**************END vars Setup***************
void setup(){
  Serial.begin(9600); // start serial communications
//**************Start Transiever (NRF24L01) config**************
  Mirf.csnPin = 9;
  Mirf.cePin = 8;
  Mirf.spi = &MirfHardwareSpi;
  Mirf.init();
  Mirf.setRADDR((byte *)"clie1");
  Mirf.payload = 4 * sizeof(byte);
  Mirf.config();
//**************End Transiever (NRF24L01) config**************

  Serial.println("Beginning ... "); // Print some stuff to serial
}
void loop(){
    
    val0 = analogRead(pot1pinX); // set val0 to read analog pin 0		
    val1 = analogRead(pot2pinY);// set val1 to read analog pin 1		
//**************convert pot to PWM values**************
      val0 = map(val0, 0, 1023, 0, 179);    
      val1 = map(val1, 0, 1023, 0, 179);
//**************convert pot to PWM values**************
//**************put values in array?**************
    byte vals[2];
        vals[0] =val0;  
        vals[1] =val1;
//**************finish puting values in array?************** 
//**************Start Transmit package**************
  Mirf.setTADDR((byte *)"serv1"); // set name of Reciever
  Mirf.send(vals); // data to send
//**************put values in array?**************
//**************Start For loop to print array to local serial**************
  int i;
  for (i = 0; i < 2; i = i + 1)
 {
 Serial.println(vals[i], DEC);
 }
//**************End For loop to print array to local serial**************
  while(Mirf.isSending()){
  
  }
  delay(10);
}

Reciever:

#include <Servo.h>
#include <Mirf.h>
#include <MirfHardwareSpiDriver.h>
#include <MirfSpiDriver.h>
#include <nRF24L01.h>
#include <SPI.h>
//**************Setup # servos to use*********
Servo myservo0;  
Servo myservo1;
// Servo myservo#;
//**************End Servo Setup***************
//***** set vars for each pots/sensor reading from transmitter
int val0; // servo 1   
int val1; // servo 2
//********************************************* 
void setup(){
    Serial.begin(9600);
//************ Pin set for servos*************
 myservo0.attach(5);  
 myservo1.attach(6);  
// End Pinset for servos
//**************Start Transiever (NRF24L01) config**************
    Mirf.csnPin = 9;
    Mirf.cePin = 8;
    Mirf.spi = &MirfHardwareSpi;
    Mirf.init();
    Mirf.setRADDR((byte *)"reci1");
    Mirf.payload = 4 * sizeof(byte);
    Mirf.config();
//**************End Transiever (NRF24L01) config**************
  Serial.println("Beginning..."); // print somthing once to Serial to know your up
}
void loop(){
//+++++++++++Start data collection from transciever+++++++++
  byte data[Mirf.payload];
  if(Mirf.dataReady()){
    do{
	Mirf.getData(data);
//*********** Start array to collect pot/sensor data *********
        val0 = data[0]; //Pot 1 on Transmitter  
        val1 = data[1]; //Pot 2 on Transmitter 
//*********** End array to collect pot/sensor data *********    
//**********End Loop to print array to Serial Monitor
int i;
  for (i = 0; i < 2; i = i + 1) {
  Serial.println(data[i], DEC);
}          
//**********End Loop to print array to Serial Monitor         
  delay(10);	
    }while(!Mirf.rxFifoEmpty());
  }
//++++++++ END data collection from transciever++++++++++++

//++++++++ Do Stuff here++++++++++++
  myservo0.write(val0); //Apply Pot 1 from trans to servo on pin 5	
                        
  myservo1.write(val1);//Apply Pot 2 from trans to servo on pin 6
//++++++++++++++++++++++++++++++++++

}  
// end of program

as it stands now they flux between say 88-94 ish on there own so i want to set up a “dead zone” to keep them from making micro movments on servos/motors and make it so i have to move it a little bit BEFOR the motors/servos acutly start

//++++++++ Do Stuff here++++++++++++
  if(val0 < 88 || val0 > 94) // <-- Add this
    myservo0.write(val0); //Apply Pot 1 from trans to servo on pin 5	
                        
  if(val1 < 88 || val1 > 94) // <-- Add this
    myservo1.write(val1);//Apply Pot 2 from trans to servo on pin 6
//++++++++++++++++++++++++++++++++++

Odd, i have tried with diffrent values and does not seem to matter.
Tried:

//++++++++ Do Stuff here++++++++++++
  if(val0 < 88 || val0 > 94) 
    myservo0.write(val0); //Apply Pot 1 from trans to servo on pin 5	
                        
  if(val1 < 88 || val1 > 94) 
    myservo1.write(val1);//Apply Pot 2 from trans to servo on pin 6
//++++++++++++++++++++++++++++++++++

And tried:

//++++++++ Do Stuff here++++++++++++
  if(val0 < 88 || val0 > 94) {
    myservo0.write(val0); //Apply Pot 1 from trans to servo on pin 5	
                        }
  if(val1 < 88 || val1 > 94) { 
    myservo1.write(val1);//Apply Pot 2 from trans to servo on pin 6
    }
//++++++++++++++++++++++++++++++++++
#include <Servo.h>
#include <Mirf.h>
#include <MirfHardwareSpiDriver.h>
#include <MirfSpiDriver.h>
#include <nRF24L01.h>
#include <SPI.h>
//**************Setup # servos to use*********
Servo myservo0;  
Servo myservo1;
// Servo myservo#;
//**************End Servo Setup***************
//***** set vars for each pots/sensor reading from transmitter
int val0; // servo 1   
int val1; // servo 2
//********************************************* 
void setup(){
    Serial.begin(9600);
//************ Pin set for servos*************
 myservo0.attach(5);  
 myservo1.attach(6);  
// End Pinset for servos
//**************Start Transiever (NRF24L01) config**************
    Mirf.csnPin = 9;
    Mirf.cePin = 8;
    Mirf.spi = &MirfHardwareSpi;
    Mirf.init();
    Mirf.setRADDR((byte *)"reci1");
    Mirf.payload = 4 * sizeof(byte);
    Mirf.config();
//**************End Transiever (NRF24L01) config**************
  Serial.println("Beginning..."); // print somthing once to Serial to know your up
}
void loop(){
//+++++++++++Start data collection from transciever+++++++++
  byte data[Mirf.payload];
  if(Mirf.dataReady()){
    do{
	Mirf.getData(data);
//*********** Start array to collect pot/sensor data *********
        val0 = data[0]; //Pot 1 on Transmitter  
        val1 = data[1]; //Pot 2 on Transmitter 
//*********** End array to collect pot/sensor data *********    
//**********Start Loop to print array to Serial Monitor

//int i;
//  for (i = 0; i < 2; i = i + 1) {
//  Serial.println(data[i], DEC);
//}          
//**********End Loop to print array to Serial Monitor         
  delay(10);	
    }while(!Mirf.rxFifoEmpty());
  }
//++++++++ END data collection from transciever++++++++++++

//++++++++ Do Stuff here++++++++++++
Serial.println(val0);
Serial.println(val1);
 if(val0 < 90 || val0 > 80){ // <-- Add this
    myservo0.write(val0); //Apply Pot 1 from trans to servo on pin 5	
 }
 if(val1 < 100 || val1 > 50){                        
    myservo1.write(val1);//Apply Pot 2 from trans to servo on pin 6
 }
//++++++++++++++++++++++++++++++++++

}  
// end of program

dunno… Also is there away to use difrent pins for the SPI lik 2-8 or so? i have a motor driver board called motomama that also had a port on it for the NRF24L01
but the main L298 uses the 8-13 pins for some damn reason.
Link to the motomama
http://iteadstudio.com/store/index.php?main_page=product_info&cPath=18&products_id=361

Also is there away to use difrent pins for the SPI lik 2-8 or so?

Not for hardware SPI. The hardware is hard-wired to use those pins.

Odd,, i have tried with diffrent values and does not seem to matter.

Time to add some Serial.print() statements to see what is in val0 and val1, then. Maybe the spot where they should no move is somewhere else.

If the center spot on the joystick is not at 512, or the complete range of values from analogRead is not 0 to 1023, the range of values to not move the servo may not be in 88 to 92.

the serial data is already there the output was about 87 ish avrage. I used like 70/100,,,75/50,,, 50/50 even they the servos moved no matter what it seems.

 if(val0 < 90 || val0 > 80){ // <-- Add this

This says that if the value is less than 90 or is greater than 80, do something. Any value in the range 0 to 179 is going to satisfy one part of the test or the other. Try using simpler logic (though redundant code) for now:

if(val0 < 84)
  myservo0.write(val0);
if(val0 > 88)
  myservo0.write(val0);
if(val1 < 84)
  myservo1.write(val1);
if(val1 > 88)
  myservo1.write(val1);

Welp kinda odd here is the code i have and ill explain what it’s doing after.

#include <Servo.h>
#include <Mirf.h>
#include <MirfHardwareSpiDriver.h>
#include <MirfSpiDriver.h>
#include <nRF24L01.h>
#include <SPI.h>
//**************Setup # servos to use*********
Servo myservo0;  
Servo myservo1;
// Servo myservo#;
//**************End Servo Setup***************
//***** set vars for each pots/sensor reading from transmitter
int val0; // servo 1   
int val1; // servo 2
int IN1 = 5; //L298   
int IN2 = 6; //L298
//********************************************* 
void setup(){
    Serial.begin(9600);
//************ Pin set for servos*************
 myservo0.attach(3);  
// myservo1.attach(6);  
// End Pinset for servos
//**************Start Transiever (NRF24L01) config**************
    Mirf.csnPin = 9;
    Mirf.cePin = 8;
    Mirf.spi = &MirfHardwareSpi;
    Mirf.init();
    Mirf.setRADDR((byte *)"reci1");
    Mirf.payload = 4 * sizeof(byte);
    Mirf.config();
//**************End Transiever (NRF24L01) config**************
  Serial.println("Beginning..."); // print somthing once to Serial to know your up
}
void loop(){
//+++++++++++Start data collection from transciever+++++++++
  byte data[Mirf.payload];
  if(Mirf.dataReady()){
    do{
	Mirf.getData(data);
//*********** Start array to collect pot/sensor data *********
        val0 = data[0]; //Pot 1 on Transmitter  
        val1 = data[1]; //Pot 2 on Transmitter 
//*********** End array to collect pot/sensor data *********    
//**********Start Loop to print array to Serial Monitor

//int i;
//  for (i = 0; i < 2; i = i + 1) {
//  Serial.println(data[i], DEC);
//}          
//**********End Loop to print array to Serial Monitor         
  delay(10);	
    }while(!Mirf.rxFifoEmpty());
  }
//++++++++ END data collection from transciever++++++++++++

//++++++++ Do Stuff here++++++++++++
//Serial.println("***********");
//Serial.print("Val0:");
//Serial.println(val0);
//Serial.println("-----------");
//Serial.print("Val1:");
//Serial.println(val1);
//Serial.println("***********");

  if(val0 < 84)
    Serial.print("Servo R:");
    Serial.println(val0);
    myservo0.write(val0);
  if(val0 > 90)
    Serial.print("Servo L:");
    Serial.println(val0);
    myservo0.write(val0);
  if(val1 < 120)
    Serial.print("Forword:");
    Serial.println(val1);
    digitalWrite(IN2,HIGH);   
    analogWrite(IN1, val1);   //PWM Speed Control
  if(val1 > 125)
    Serial.print("Reverse:");
    Serial.println(val1);
    digitalWrite(IN2,LOW);   
    analogWrite(IN1, val1);   //PWM Speed Control
  

//************************* Old code************************************
//    myservo0.write(val0); //Apply Pot 1 from trans to servo on pin 5	

//    digitalWrite(IN2,HIGH);   
//    analogWrite(IN1, val1);   //PWM Speed Control

//    myservo1.write(val1);//Apply Pot 2 from trans to servo on pin 6
//++++++++++++++++++++++++++++++++++

}  
// end of program

So when i power up the Reciever Ard the small motor i have attached starts to spin in the (Forword) when i move the stick up it starts to slow down in the forword if i pull back on the stick it foes forward even faster odd. BUT i have print code at each IF statment and when the sticks are centerd all that prints are the # no Servo l or R or no Forword or Backword thos trigger when i move the sticks up or down or left and right. The servo seems to dance a lot when i move it to the right but not left.

1.Why is the base # printing to serial in the first place with out tripping and if statement?. ( should only get print from F/B L/R)
2.Why is the servo dancing on right but not left?
3.Why is the motor in motion at center.?
4.Why does the code for the motor not move it forword/reverse. ( prob same reason its running at center).