user17140: I successfully run the AccelStepper examples on an Arduino Mega with a RAMPS 1.4 shield, two A4988 stepper motor drivers and two 17HS16-0284S stepper motors. 
I used 3 jumpers on the RAMPS to set the microstep resolution to 1/16.
I used this code inspired by the Polargraph Server for Polargraph:
#include <AccelStepper.h>

/* 
// for the Arduino Uno + CNC shield V3

#define MOTOR_A_ENABLE_PIN 8
#define MOTOR_A_STEP_PIN 2
#define MOTOR_A_DIR_PIN 5

#define MOTOR_B_ENABLE_PIN 8
#define MOTOR_B_STEP_PIN 3
#define MOTOR_B_DIR_PIN 6
*/

// for the Arduino Mega + RAMPS 1.4
#define MOTOR_A_ENABLE_PIN 30
#define MOTOR_A_STEP_PIN 36
#define MOTOR_A_DIR_PIN 34

#define MOTOR_B_ENABLE_PIN 56
#define MOTOR_B_STEP_PIN 60
#define MOTOR_B_DIR_PIN 61

AccelStepper motorA(1, MOTOR_A_STEP_PIN, MOTOR_A_DIR_PIN); 
AccelStepper motorB(1, MOTOR_B_STEP_PIN, MOTOR_B_DIR_PIN); 

void setup()
{
  motorA.setEnablePin(MOTOR_A_ENABLE_PIN);
  motorA.setPinsInverted(false, false, true);
  motorB.setEnablePin(MOTOR_B_ENABLE_PIN);
  motorB.setPinsInverted(false, false, true);

  motorA.setAcceleration(100);  
  motorA.move(1000);
  //motorA.setMaxSpeed(100);
  //motorA.setSpeed(100);

  motorB.setAcceleration(100);  
  motorB.move(1000);
  //motorB.setMaxSpeed(100);
  //motorB.setSpeed(100);

  motorA.enableOutputs();
  motorB.enableOutputs();
}

void loop()
{

  motorA.run();
  motorB.run();

}

I tried to use the same code with the same stepper motor drivers and motors on a Arduino Uno and a CNC shield v3 without success (I also used the 3 jumpers to set the microstep resolution to 1/16). The motors do not work and jitter.
What is wrong with my code?
Bonus questions:
I have taken this setup and code from the Polargraph server but I didn't get how I'm suppose to know how to use setEnablePin() and setPinsInverted() methods. In fact, I have troubles finding documentation about the CNC shield V3 and the A4988 drivers (I only found this page) to work with AccelStepper.

user26994: Manually set the ENABLE pins as OUTPUTs, i.e. add in the setup() function:
pinMode(MOTOR_A_ENABLE_PIN, OUTPUT);
pinMode(MOTOR_B_ENABLE_PIN, OUTPUT);


17140: <p>I successfully run the <a href="http://www.airspayce.com/mikem/arduino/AccelStepper/examples.html" rel="nofollow">AccelStepper examples</a> on an <a href="https://www.arduino.cc/en/Main/ArduinoBoardMega2560" rel="nofollow">Arduino Mega</a> with a <a href="http://reprap.org/wiki/RAMPS_1.4" rel="nofollow">RAMPS 1.4</a> shield, two <a href="https://www.pololu.com/product/1182" rel="nofollow">A4988 stepper motor drivers</a> and two <a href="http://www.omc-stepperonline.com/nema-17-bipolar-stepper-motor-028a-36ncm51ozin-17hs160284s-p-80.html" rel="nofollow">17HS16-0284S stepper motors</a>. </p>

<p>I used 3 jumpers on the RAMPS to set the microstep resolution to 1/16.</p>

<p>I used this code inspired by the <a href="https://github.com/euphy/polargraph_server_polarshield" rel="nofollow">Polargraph Server</a> for <a href="http://www.polargraph.co.uk/" rel="nofollow">Polargraph</a>:</p>

<pre><code>#include &lt;AccelStepper.h&gt;

/* 
// for the Arduino Uno + CNC shield V3

#define MOTOR_A_ENABLE_PIN 8
#define MOTOR_A_STEP_PIN 2
#define MOTOR_A_DIR_PIN 5

#define MOTOR_B_ENABLE_PIN 8
#define MOTOR_B_STEP_PIN 3
#define MOTOR_B_DIR_PIN 6
*/

// for the Arduino Mega + RAMPS 1.4
#define MOTOR_A_ENABLE_PIN 30
#define MOTOR_A_STEP_PIN 36
#define MOTOR_A_DIR_PIN 34

#define MOTOR_B_ENABLE_PIN 56
#define MOTOR_B_STEP_PIN 60
#define MOTOR_B_DIR_PIN 61

AccelStepper motorA(1, MOTOR_A_STEP_PIN, MOTOR_A_DIR_PIN); 
AccelStepper motorB(1, MOTOR_B_STEP_PIN, MOTOR_B_DIR_PIN); 

void setup()
{
  motorA.setEnablePin(MOTOR_A_ENABLE_PIN);
  motorA.setPinsInverted(false, false, true);
  motorB.setEnablePin(MOTOR_B_ENABLE_PIN);
  motorB.setPinsInverted(false, false, true);

  motorA.setAcceleration(100);  
  motorA.move(1000);
  //motorA.setMaxSpeed(100);
  //motorA.setSpeed(100);

  motorB.setAcceleration(100);  
  motorB.move(1000);
  //motorB.setMaxSpeed(100);
  //motorB.setSpeed(100);

  motorA.enableOutputs();
  motorB.enableOutputs();
}

void loop()
{

  motorA.run();
  motorB.run();

}
</code></pre>

<p>I tried to use the same code with the same stepper motor drivers and motors on a <a href="https://www.arduino.cc/en/Main/ArduinoBoardUno" rel="nofollow">Arduino Uno</a> and a <a href="http://blog.protoneer.co.nz/arduino-cnc-shield-v3-00-assembly-guide/" rel="nofollow">CNC shield v3</a> without success (I also used the 3 jumpers to set the microstep resolution to 1/16). The motors do not work and jitter.</p>

<p>What is wrong with my code?</p>

<p><strong>Bonus questions</strong>:
I have taken this setup and code from the Polargraph server but I didn't get how I'm suppose to know how to use <code>setEnablePin()</code> and <code>setPinsInverted()</code> methods. In fact, I have troubles finding documentation about the CNC shield V3 and the A4988 drivers (I only found <a href="http://blog.protoneer.co.nz/arduino-cnc-shield-v3-00-assembly-guide/" rel="nofollow">this page</a>) to work with AccelStepper.</p>
 26994: <p>Manually set the ENABLE pins as OUTPUTs, i.e. add in the <code>setup()</code> function:</p>

<pre><code>pinMode(MOTOR_A_ENABLE_PIN, OUTPUT);
pinMode(MOTOR_B_ENABLE_PIN, OUTPUT);
</code></pre>
