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();
}