Xbox 360 Wireless controller and Sabertooth 2x25 Motor Controller

Hello, I was wondering if anyone has any ideas as to why this isn't working correctly. I have a Sabertooth 2x25 motor controller connected to an Arduino and 2 wheel chair motors. I am using a Xbox wireless controller to send commands. I have it programmed so that when I press up on the left stick it sends a range of signals from 0 to 127 to the left motor and when I press down it sends a range from 0 to -127 to the left motor (The Xbox controller uses a wider range but the program converts it to the 0 to 127 range). I have the same setup for the right stick and right motor. I understand that this is the range that the Sabertooth uses to control motors. Is this the correct range? It seems that one direction or the other for one motor works but its random as to which motor works. The Sabertooth has 4 pins: 5V, Ground, Signal 1 and Signal 2.

I have the 5V connected to the 5V on the Arduino and the same for the Ground.
I have Signal 1 connected to Pin 5 on the Arduino and Signal 2 connected to the Pin 6. I then have the Sabertooth dip switches configured as per the Sabertooth manual for Independent motor control and acid battery.

This is my code which I mostly found in an example but have modified slightly (I'm no programmer):

#include<XBOXRECV.h>
#ifdef dobogusinclude
#include <spi4teensy3.h>
#include <SPI.h>
#endif

USB Usb;
XBOXRECV Xbox(&Usb);

int powerL;
int powerR;

void setup() {
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
Serial.begin(9600);
#if !defined(MIPSEL)
while (!Serial); // Wait for serial port to connect - used on Leonardo, Teensy and other boards with built-in USB CDC serial connection
#endif
if (Usb.Init() == -1) {
Serial.print(F("\r\nOSC did not start"));
while (1); //halt
}
Serial.print(F("\r\nXbox Wireless Receiver Library Started"));
}

void loop() {
Usb.Task();
if (Xbox.XboxReceiverConnected)
{
if(Xbox.Xbox360Connected)
{
if(Xbox.getAnalogHat(LeftHatY) >7500 || Xbox.getAnalogHat(LeftHatY) < -7500 )
{
if(Xbox.getAnalogHat(LeftHatY) >7500)
{
powerL = map(Xbox.getAnalogHat(LeftHatY), 7500 , 32767 , 0 , 127);
analogWrite(5,powerL);
Serial.print(F("powerL: "));
Serial.println(powerL);
}
if (Xbox.getAnalogHat(LeftHatY) < -7500)
{
powerL = map(Xbox.getAnalogHat(LeftHatY), -7500 , -32767 , 0 , -127);
analogWrite(5,powerL);
Serial.print(F("powerL: "));
Serial.println(powerL);
}
}
if (Xbox.getAnalogHat(LeftHatY) < 7500 && Xbox.getAnalogHat(LeftHatY) > -7500)
{
powerL = 0;
analogWrite(5,powerL);
Serial.println(powerL);
}

if(Xbox.getAnalogHat(RightHatY) >7500 || Xbox.getAnalogHat(RightHatY) < -7500)
{
if(Xbox.getAnalogHat(RightHatY) >7500)
{
powerR = map(Xbox.getAnalogHat(RightHatY), 7500 , 32767 , 0 , 127);
analogWrite(6,powerR);
Serial.print(F("powerR: "));
Serial.println(powerR);
}
if (Xbox.getAnalogHat(RightHatY) < -7500)
{
powerR = map(Xbox.getAnalogHat(RightHatY), -7500 , -32767 , 0 , -127);
analogWrite(6,powerR);
Serial.print(F("powerR: "));
Serial.println(powerR);
}
}
if (Xbox.getAnalogHat(RightHatY) < 7500 && Xbox.getAnalogHat(RightHatY) > -7500)
{
powerR = 0;
analogWrite(6,powerR);
Serial.println(powerR);
}
}
}
}

Any ideas? Something I'm missing? I would greatly appreciate any help.