Controlling Servos by MPU 6050 Acc/Gyro via Wireless Medium

I am building a Project "Controlling Servos by MPU 6050 Acc/Gyro via Wireless Medium". Wireless medium for now i am using 433 MHZ RF Transmitter/ Receiver Module. I am able to establish connection bw Servos and MPU6050 through a Wired Connection but Need Help in Establishing Connection through a Wirelesss Meduim.

Need Help in Coding For the Transmitter and Receiver. I Understand only the basics of the coding and Hence could not Start the Coding.

Please Help with the Coding or Guide how to Establish Connection through a Wirelesss Meduim. Thank you

hey did you solve your problem???

I am trying to make a project where i want to control 2 servos as output, MPU 6050 (accelerometer) as an Input through a wireless medium 2.4ghz (xbee). i am not good in coding but through hit an trials i got upto this program for Transmitter side and Receiver Side. i have very little idea about the coding.

if anybody could help me in re-writing the code as to which it works perfectly would highly be appreciated.

i am trying again and again but no success…i dont want to loose hope.

Code for TX side

#include “Wire.h”
#include “I2Cdev.h”
#include “MPU6050.h”

MPU6050 mpu;

int16_t ax, ay, az;
int16_t gx, gy, gz;

int valX;
int prevValX;
int valY;
int prevValY;

void setup()
{
Wire.begin();
Serial.begin(38400);

Serial.println(“Initialize MPU”);
mpu.initialize();
Serial.println(mpu.testConnection() ? “Connected” : “Connection failed”);

}

void loop()
{
mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);

valX = map(ax, 750, 200, 119, 179);

valY = map(ay, 200, 700, 119, 179);

Serial.print(analogRead(valX));
Serial.print("\t");
Serial.print(analogRead(valY));

Serial.println();

delay(200);
}

accelerometer values are coming from 200 to 700

Code for Receiver Side

#include “Wire.h”
#include “I2Cdev.h”
#include “MPU6050.h”
#include <Servo.h>

Servo Xservo;
Servo Yservo;

int valX;
int prevValX;
int valY;
int prevValY;

void setup()
{
Xservo.attach(9);
Yservo.attach(10);
Serial.begin(38400);
Xservo.write(0);
Yservo.write(0);
}

void loop()
{
if(Serial.available() > 0) {
valX = Serial.read();

if (valX != prevValX)
{
Xservo.write(valX);
prevValX = valX;
}
{
if(Serial.available() > 0) {
valY = Serial.read();

if (valY != prevValY)
{
Yservo.write(valY);
prevValY = valY;
}}}
delay(200);
}}

if you suggest a new coding please share…ill try that instead of this

Harkirat