Hi
My Motor doesn't move, i think its a problem with the code
// Stepper
#include <Stepper.h>
// steps value is 360 / degree angle of motor
#define STEPS 200
// create a object on pins 6 and 7
Stepper stepper(STEPS, 6,7);
void setup()
{
}
void loop()
{
///// Turn the stepper 200 steps with a 1 sec delay between steps at 60rpm
/// then reverse the direction and do 50 steps at 20rpm with a 1sec delay between steps
stepper.setSpeed(1);
stepper.step(200);
//delay(1000);
//stepper.setSpeed(20);
//stepper.step(-50);
//delay(1000);
}
i am using 12V battery, this motor:
i am attaching a pic of the Arduino for you to look at.
///// Turn the stepper 200 steps with a 1 sec delay between steps at 60rpm
/// then reverse the direction and do 50 steps at 20rpm with a 1sec delay between steps
stepper.setSpeed(1);
1 sec delay between steps at 60 RPM doesn't make sense. If you have a 200 step motor and 60 RPM, it will need 200 steps per second, not 1. Likewise, 1 second between steps is about 60/200 RPM, or 0.3RPM.
stepper.setSpeed(1) sets your speed to 1 RPM, not 60. Try setting the value to 100 or so and see if it is actually working.