Certainly I can post some code I used....
const int JOYPIN_X = A0;
const int JOYPIN_Y = A1;
const int JOYPIN_Z = A2;
const int STEERPIN = A3;
const int GASPIN = A4;
const int POSRESET = 12;
const int ENGINEKILL = 9;
// Define Outputs
const int STEERMOTPOS = 11;
const int STEERMOTNEG = 10;
const int GASMOTPOS = 6;
const int GASMOTNEG = 5;
const int FRONTPROPPOS = 8;
const int FRONTPROPNEG = 7;
const int KILLSWITCH = 4;
// Define Thresholds
const int X_TOL = 10;
const int Y_TOL = 10;
const int Z_TOL = 510;
void setup()
{
Serial.begin(9600);
pinMode(STEERMOTPOS, OUTPUT);
pinMode(STEERMOTNEG, OUTPUT);
pinMode(GASMOTPOS, OUTPUT);
pinMode(GASMOTNEG, OUTPUT);
pinMode(FRONTPROPPOS, OUTPUT);
pinMode(FRONTPROPNEG, OUTPUT);
pinMode(KILLSWITCH, OUTPUT);
pinMode(POSRESET, INPUT);
pinMode(ENGINEKILL, INPUT);
digitalWrite(POSRESET, HIGH);
digitalWrite(ENGINEKILL, HIGH);
}
void loop()
{
//Get Input Values
int JOYXNOW = analogRead(JOYPIN_X);
int JOYYNOW = analogRead(JOYPIN_Y);
int JOYZNOW = analogRead(JOYPIN_Z);
int STEERNOW = analogRead(STEERPIN);
int GASNOW = analogRead(GASPIN);
//Compare Values
if (JOYXNOW + X_TOL <= STEERNOW) {
Serial.println("LEFT");
} else if (JOYXNOW - X_TOL >= STEERNOW) {
Serial.println("RIGHT");
}
}