What are the pins i need to use in declaring a instance of object of type stepper
Stepper(revs, PIN1, PIN2, PIN3, PIN4)
To what pins correspond pin1, 2, 3, 4 if i use th earduino motor shield ?
What are the pins i need to use in declaring a instance of object of type stepper
Stepper(revs, PIN1, PIN2, PIN3, PIN4)
To what pins correspond pin1, 2, 3, 4 if i use th earduino motor shield ?
#include <Stepper.h>
// change this to fit the number of steps per revolution
// for your motor
const int stepsPerRevolution = 48;
// give the motor control pins names:
const int pwmA = 3;
const int pwmB = 11;
const int brakeA = 9;
const int brakeB = 8;
const int dirA = 12;
const int dirB = 13;
// initialize the stepper library on the motor shield
Stepper myStepper(stepsPerRevolution, dirA,dirB);
void setup() {
Serial.begin(9600);
// set the PWM and brake pins so that the direction pins
// can be used to control the motor:
pinMode(pwmA, OUTPUT);
pinMode(pwmB, OUTPUT);
pinMode(brakeA, OUTPUT);
pinMode(brakeB, OUTPUT);
digitalWrite(pwmA, HIGH);
digitalWrite(pwmB, HIGH);
digitalWrite(brakeA, LOW);
digitalWrite(brakeB, LOW);
// set the motor speed (for multiple steps only):
myStepper.setSpeed(2);
}