Go Down

Topic: AccelStepper problem (Read 1 time) previous topic - next topic



not sure if this should go in programming or general electronics... trying to get the AccelStepper library to work and just not making any headway. I have the hardware setup exactly as in the tutorial for MotorKnob from the stepper library (http://arduino.cc/it/Tutorial/MotorKnob) with the  SN754410NE H-Bridge chip to drive it. When I run the example stepper code on it - all works fine :(i have my stepper plugged in on pins 14,15,16,17)

Code: [Select]
#include <Stepper.h>

// change this to the number of steps on your motor
#define STEPS 100

// create an instance of the stepper class, specifying
// the number of steps of the motor and the pins it's
// attached to
Stepper stepper(STEPS, 14, 15, 16, 17);

// the previous reading from the analog input
int previous = 0;

void setup()
  // set the speed of the motor to 30 RPMs

void loop()
  // get the sensor value
  int val = analogRead(0);

  // move a number of steps equal to the change in the
  // sensor reading
  stepper.step(val - previous);

  // remember the previous value of the sensor
  previous = val;

but when i try to run on the same setup the basic AccelStepper code :

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

#include <AccelStepper.h>

AccelStepper stepper(14, 15, 16, 17);

void setup()


void loop()


I get nothing- the stepper just does not move at all. As far as I could tell from my research online I was under the impression that the code should work with the same schematic as for the stepper library and with that H-bridge. I know that the hardware does work and there is no fault there.. but something just doesn't add up.

Was wondering if anyone had much experience with the AccelStepper library and had any working examples?

thank you for your time..

Go Up