I feed the code below to run my stepper motor + Driver, and I need to add another line for pin 6 = low for CW and high for CCW, would anyone kindly fill the that line for me?
void setup()
{
analogWrite(5,100);
}
void loop()
{
}
I feed the code below to run my stepper motor + Driver, and I need to add another line for pin 6 = low for CW and high for CCW, would anyone kindly fill the that line for me?
void setup()
{
analogWrite(5,100);
}
void loop()
{
}
You need 2 outputs for a step & direction driver. On pin is either HIGH or LOW for direction, and on pin that toggles HIGH and LOW for every step.
What are you trying to do?
Hi Kf2qd,
Yes I know I need 2 outputs, but my c language is not that good, I know little PBasic.
I have tried wii nunchuck with 2 RC servo with this code provided by: http://www.fabiobiondi.com/blog/2009/12/wii-nunchuck-controller-and-arduino/
and now I plan to use wii nunchuck or an accelerometer to control 3 stepper motor, where the stepper driver accepts Step, Direction, & +5v for Puls+ and Step+, but
for now I would like to try a simple code for start, use input buttons to control cw & ccw, let say when button A is pressed = cw and when button B is pressed = ccw.
For Pbasic:
main:
if button A = 1 then cw
if Button B = 0 then ccw
cw:
···· Pulsout 3,200 (step signal to Driver board)
high 4 ( a high signal to DIR)
goto main
ccw:
pulsout 5,200
low 6 ( a low signal to DIR)
goto main
thanks
It is time to do a lot of learning, you don't know enough to do this project yet, read the following links:-
Grumpy_Mike,
This is waht I have done with Picaxe: - YouTube
Sending a pulse to Driver's Puls- and touch Dir- to gnd pin of Picaxe for ccw, not connected = cw
This driver works the same way as Easydriver.
Here's is a code from D.Thimpson's arduino(http://danthompsonsblog.blogspot.tw/2010/05/easydriver-42-tutorial.html), I tested with my Arduino board: - YouTube
I was going to mod the code to just 1 continuous rotation, but need some help.
but need some help.
Help is what we supply but what we don't do is to do it for you.
You need to learn how code is structured on this processor. What you posted previously was just a random collection of words.
So do a few tutorials first. The simple blink an LED is very close to what you want to do. Instead of turning the LED on and off you just set your step signal high or low. Then the direction is simply an input which directly defines the state of an output.
So have a go at writing it. Get it to compile. Then if it doesn't do what you want post the code, say what it does do and say what you want it to do.