Accelstepper with TB6600?

Hi all. I'm trying to run the accelstepper library with my TB6600 driver and stepper motor 17HS4401.

The motor has 4 wires that connect to the drivers A and B terminals.

The driver then connects to the Arduino through its DIR, PUL and ENA pins.

Q: I don't know how to set up the accelstepper pins. The instructions aren't clear to me without an example for my setup?

Instructions: Accelstepper instructions

My attempt: (too many pins where accelstepper is set at the top of the code)

// ConstantSpeed.pde
// -*- mode: C++ -*-
//
// Shows how to run AccelStepper in the simplest,
// fixed speed mode with no accelerations
/// \author  Mike McCauley (mikem@airspayce.com)
// Copyright (C) 2009 Mike McCauley
// $Id: ConstantSpeed.pde,v 1.1 2011/01/05 01:51:01 mikem Exp mikem $

#include <AccelStepper.h>

AccelStepper::AccelStepper   (   uint8_t   interface = AccelStepper::DRIVER,
    uint8_t   pin1 = 2,
    uint8_t   pin2 = 3,
    uint8_t   pin3 = 4,
    uint8_t   pin4 = 5,
    bool    enable = true 
  )     

void setup()
{  
   stepper.setMaxSpeed(1000);
   stepper.setSpeed(50);	
}

void loop()
{  
   stepper.runSpeed();
}

SOLVED: I found an answer where this is used:

AccelStepper stepper(1,8,9); // 8 = pulse, 9 = direction

1 specifies 1 motor is being used, 8 and 9 are pins and the ENA was not being used so I attached to ground.

You need to use the DRIVER option for AccelStepper so you create the accelStepper instance like this

AccelStepper myStepper(1, stepPin, directionPin);

Assuming you don't need to control the ENA pin then just connect it to GND or 5v - whichever is necessary to enable it.

...R

Thanks for confirming that Robin, wasn't too clear on the instructions for me