Sander 16
hello, i have been working on a machine for a while now, i have 3d printed out the parts i need, and now need to write the programme for the motor, its for a standard 5v stepper motor. i need the motor to rotate clockwise for a minute, and then anti clockwise for a minute. and then stop for mabye an hour.
i know i can use the "delay" command to make the motor stand still. but it still draws power and heats up, which would be a problem, because it cant get to hot in the machine.
i read that i could write:
digitalWrite(8,LOW);
** digitalWrite(9,LOW);**
** digitalWrite(10,LOW);**
** digitalWrite(11,LOW);**
to shut off the motor, which workes, but then thats it it just stays turned off it doesnt repeat the cycle of turning clockwise - anti clockwise - off for an hour - turning clockwise - anti clockwise - off for an hour...
ive never written any code before, so i dont know how to make it only turn off for a defined ammount of time. if anybody knows how to do this, could you help me out?
heres the code ive got so far:
#include <Stepper.h>
#define STEPS 2038
Stepper stepper(STEPS, 8, 10, 9, 11);
void setup()
{ **
** stepper.setSpeed(6);
** stepper.step(12228);**
** delay(0);**
** stepper.setSpeed(6);**
** stepper.step(-12228);**
** digitalWrite(8,LOW);**
** digitalWrite(9,LOW);**
** digitalWrite(10,LOW);**
** digitalWrite(11,LOW); **
}
void loop()
{}