0

Can't get stepper working
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Can't get stepper working

by Techguy817 on Wed Oct 21, 2020 8:05 pm

Hi All,

Just soldered the headers to the motor shield and put it on top of my Leonardo board. Trying to test a stepper motor but not getting anything. Referring to https://learn.adafruit.com/adafruit-mot ... per-motors.

Code: Select all | TOGGLE FULL SIZE
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include <Adafruit_PWMServoDriver.h>

Adafruit_MotorShield AFMS = Adafruit_MotorShield();
Adafruit_StepperMotor *myMotor = AFMS.getStepper(200, 2);

void setup() {
  Serial.begin(9600);           // set up Serial library at 9600 bps
  Serial.println("Stepper test!");
 
  myMotor->setSpeed(10);  // 10 rpm   
  myMotor->step (100, FORWARD, SINGLE);
}

void loop() {
    myMotor->step (100, FORWARD, SINGLE);
}


Compiles and loads successfully but nothing actually happens. What am I missing?

Techguy817
 
Posts: 17
Joined: Fri Oct 16, 2020 11:44 pm

Re: Can't get stepper working

by adafruit_support_bill on Wed Oct 21, 2020 8:59 pm

Please post the electrical specs for the stepper you are using and some photos showing your connections.

adafruit_support_bill
 
Posts: 81566
Joined: Sat Feb 07, 2009 10:11 am

Re: Can't get stepper working

by Techguy817 on Wed Oct 21, 2020 9:07 pm

Just got it working. Apparently I wasn't calling the begin() function. Must have missed that part in the tutorial.

Techguy817
 
Posts: 17
Joined: Fri Oct 16, 2020 11:44 pm

Re: Can't get stepper working

by adafruit_support_bill on Wed Oct 21, 2020 9:20 pm

Good to hear that is working. Thanks for the update.

adafruit_support_bill
 
Posts: 81566
Joined: Sat Feb 07, 2009 10:11 am

Please be positive and constructive with your questions and comments.


cron