I also purchased your 12v 200 step motor. PID 324
Your motor came with the following colored wires and no labeling/key.
Green
Yellow
Red
Gray
Which wire goes where on my shield?
Your sample sketch does not compile.
[Edit - moderator - please use the 'code' button when posting code]
- Code: Select all
// Adafruit Motor shield library
// copyright Adafruit Industries LLC, 2009
// this code is public domain, enjoy!
#include <AFMotor.h>
// Connect a stepper motor with 48 steps per revolution (7.5 degree)
// to motor port #2 (M3 and M4)
AF_Stepper motor(200, 2);
void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("Stepper test!");
motor.setSpeed(10); // 10 rpm
}
void loop() {
Serial.println("Single coil steps");
motor.step(100, FORWARD, SINGLE);
motor.step(100, BACKWARD, SINGLE);
Serial.println("Double coil steps");
motor.step(100, FORWARD, DOUBLE);
motor.step(100, BACKWARD, DOUBLE);
Serial.println("Interleave coil steps");
motor.step(100, FORWARD, INTERLEAVE);
motor.step(100, BACKWARD, INTERLEAVE);
Serial.println("Micrsostep steps");
motor.step(100, FORWARD, MICROSTEP);
motor.step(100, BACKWARD, MICROSTEP);
}
Below are the errors I get when I compile.
StepperTest.pde:-1: error: 'AF_Stepper' does not name a type
StepperTest.cpp: In function 'void setup()':
StepperTest.pde:-1: error: 'motor' was not declared in this scope
StepperTest.cpp: In function 'void loop()':
StepperTest.pde:-1: error: 'motor' was not declared in this scope
StepperTest.pde:-1: error: 'FORWARD' was not declared in this scope
StepperTest.pde:-1: error: 'SINGLE' was not declared in this scope
StepperTest.pde:-1: error: 'BACKWARD' was not declared in this scope
StepperTest.pde:-1: error: 'DOUBLE' was not declared in this scope
StepperTest.pde:-1: error: 'INTERLEAVE' was not declared in this scope
StepperTest.pde:-1: error: 'MICROSTEP' was not declared in this scope

