Controlling multiple servos using a pot via xbee

For the sender part: ' easy transfer' does not name a type.

You can't have space in names.
More likely, you didn't install the library (was that the only error message?), or you didn't restart the IDE.

well i did all of that and the same error keeps showing up

allen121:
well i did all of that and the same error keeps showing up

In the Arduino program, if you click on 'File' and then 'Examples', do you see 'EasyTransfer'?

It should be above EEPROM

yes i can see it

allen121:
yes i can see it

Well, try compiling one of the example sketches under 'EasyTransfer' and see if you get the same error.

nope i dont get the error, but when i compile that code i get the error, it strange

allen121:
nope i dont get the error, but when i compile that code i get the error, it strange

Can you copy this code again here please?

#include <EasyTransfer.h>
EasyTransfer ET;

int potpin1 = 0;
int potpin2 = 1;

struct SEND_DATA_STRUCTURE{
  int servo1val;
  int servo2val;
};

SEND_DATA_STRUCTURE txdata;

void setup(){
  Serial.begin(115200);
  ET.begin(details(txdata), &Serial);
  pinMode(potpin1, INPUT);
  pinMode(potpin2, INPUT);
 
}

void loop(){
  txdata.servo1val = analogRead(potpin1);
  txdata.servo2val = analogRead(potpin2);
 
  ET.sendData();
  
}




receiver end 


#include <Servo.h>

#include <EasyTransfer.h>
EasyTransfer ET;

Servo myservo1;
Servo myservo2;


struct RECEIVE_DATA_STRUCTURE{
  int servo1val;
  int servo2val;
};

RECEIVE_DATA_STRUCTURE txdata;

void setup(){
  Serial.begin(115200);
 
  ET.begin(details(txdata), &Serial);
  myservo1.attach(9);
  myservo2.attach(10);
}

void loop(){
  if(ET.receiveData()){
   
    myservo1.write(map(txdata.servo1val, 0, 1023, 0, 179));
    myservo2.write(map(txdata.servo2val, 0, 1023, 0, 179));
    
  }
}

allen121:

pinMode(potpin1, INPUT);

pinMode(potpin2, INPUT);




Get rid of this because these are analog inputs and they don't use pinMode. 

Try doing the mapping on the sender's side and send the integer to the servos on the receiving side to write. 

Are you getting the same problem when you compile the code for the receiving end. I honestly don't see anything else that's wrong.

i have modified the code as stated please do check the receivers side because i dont know what i should do there,

#include <EasyTransfer.h>
EasyTransfer ET;

int potpin1 = 0;
int potpin2 = 1;

struct SEND_DATA_STRUCTURE{
  int servo1val;
  int servo2val;
};

SEND_DATA_STRUCTURE txdata;

void setup(){
  Serial.begin(115200);
  ET.begin(details(txdata), &Serial);
  pinMode(potpin1, INPUT);
  pinMode(potpin2, INPUT);
 
}

void loop(){
  txdata.servo1val = analogRead(potpin1);
  txdata.servo2val = analogRead(potpin2);
   int val1 = map(potpin1, 0, 1023, 0, 179);
  int val2 = map(potpin2, 0, 1023, 0, 179);
  ET.sendData();
  
}

receiver end

#include <Servo.h>

#include <EasyTransfer.h>
EasyTransfer ET;

Servo myservo1;
Servo myservo2;


struct RECEIVE_DATA_STRUCTURE{
  int servo1val;
  int servo2val;
};

RECEIVE_DATA_STRUCTURE txdata;

void setup(){
  Serial.begin(115200);
 
  ET.begin(details(txdata), &Serial);
  myservo1.attach(9);
  myservo2.attach(10);
}

void loop(){
  if(ET.receiveData()){
   
    myservo1.write(map(txdata.servo1val, 0, 1023, 0, 179));
    myservo2.write(map(txdata.servo2val, 0, 1023, 0, 179));
    
  }
}

i really dont understand what the issue is each and every time i compile the code

EasyTransfer ET;

this highlights and says 'EasyTransfer' does not name a type

any idea why this occurs

Actually the problem is back, now i cant run the example also this same error shows up. I just dont know what is happeing

When you downloaded the EasyTransfer library you would have got something like this, after unzipping:

You have to copy each of those (4) folders individually into your libraries folder, not the whole folder named "madsci1016-Arduino-EasyTransfer-c4e728f". Then restart the IDE. Then the examples should compile.

@ Nick
that was the problem, thanks for the help, it works now.