I used a While lop to see if the release command works. it doesn't. what am I doing wrong?
Here's is the code:
Code: Select all
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_PWMServoDriver.h"
// Create the motor shield object with the default I2C address
Adafruit_MotorShield AFMS = Adafruit_MotorShield();
// Or, create it with a different I2C address (say for stacking)
// Adafruit_MotorShield AFMS = Adafruit_MotorShield(0x61);
// Connect a stepper motor with 200 steps per revolution (1.8 degree)
// to motor port #2 (M3 and M4)
Adafruit_StepperMotor *myMotor = AFMS.getStepper(400, 2); //.9 deg steps
void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("Stepper test!");
AFMS.begin(); // create with the default frequency 1.6KHz
//AFMS.begin(1000); // OR with a different frequency, say 1KHz
Adafruit_StepperMotor *myMotor = AFMS.getStepper(400, 2);
// define stepper#2
myMotor->setSpeed(150); // 150 rpm
}
void loop()
{
int count=0;
Serial.println("DoubleStep Forward");
myMotor->step(100, FORWARD, DOUBLE);
Serial.println("DoubleStep Backward");
myMotor->step(100, BACKWARD, DOUBLE);
Serial.println("Release");
void release(void); //still doesn't release
Serial.println("wait");
while(count<1000)
{ Serial.println(count);
count++; }
}
Notso schmartguy1