Controlling Continuous Motion Vex Servo Motors

Hi everyone.
I am building a robot using the Vex Robotics Platform that is being controlled by an Arduino Mega 2560. I have two Vex Continuous Motion Servos which are connected to the board via a servo sensor IO shield. Everywhere I’ve looked, its told me to control it through servo.write(180) to go forward an servo.write(0) to go reverse and so on; however it doesn’t move the motors at all, instead using PWM works to control them, but they still act weird (like 255 turns them forward, but so dos 100). I’ve tried declaring the pins as Servos and using PWM but that does not work either. Am I missing something?


#include "Servo.h"
#include <Wii.h>
#include <usbhub.h>
// Satisfy IDE, which only needs to see the include statment in the ino.
#ifdef dobogusinclude
#include <spi4teensy3.h>

USB Usb;
//USBHub Hub1(&Usb); 

BTD Btd(&Usb); 
WII Wii(&Btd, PAIR);
//WII Wii(&Btd); 

Servo wrist;
Servo shoulder;
Servo left; //<--------- This is the left motor
Servo right;// <------------This is the right motor
bool printAngle;

int val_1 = 90;
int val_2 = 90;
int val_3;

int x;
int y;

int drive_left,drive_right; 

void setup() {
  while (!Serial); // Wait for serial port to connect - used on Leonardo, Teensy and other boards with built-in USB CDC serial connection
  if (Usb.Init() == -1) {
    Serial.print(F("\r\nOSC did not start"));
    while (1); //halt
  Serial.print(F("\r\nWiimote Bluetooth Library Started"));
void loop() {

    //Other code...//

    if (Wii.getAnalogHat(HatY)>150)
      analogWrite(5, 128);
      analogWrite(6, 250);
    else if (Wii.getAnalogHat(HatY)<120)
      analogWrite(5, 250);
      analogWrite(6, 128);
    else if (Wii.getAnalogHat(HatY)>120 && Wii.getAnalogHat(HatY)<150 && Wii.getAnalogHat(HatX)>110 && Wii.getAnalogHat(HatX)<150)
      analogWrite(5, 0);
      analogWrite(6, 0);
    else if (Wii.getAnalogHat(HatX) < 110)
      analogWrite(5, 255);
      analogWrite(6, 255);
    else if (Wii.getAnalogHat(HatX) > 150)
      analogWrite(5, 128);
      analogWrite(6, 128);