Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/18/08 20:41
Read: times


 
#153692 - Stepper Motor
hi guys,
I'm doing a project where I need to move a stepper motor upto a certain degree
both clockwise and anticlockwise. I've written a code for it using 4 step sequence
and it moves ok in both directions.But the problem arises when I try to move it
upto only a single step angle. According to my code it's supposed to
stop after a 7.5 degree step but it keeps moving. It seems my whole program is inside
a loop although i'm not using any loop. The code I wrote is like the following -

#include <REG51xD2.H>

void delay(unsigned int);

void main()
{
P0 = 0x66;
delay(1);
P0 = 0xCC;
delay(1);
P0 = 0x99;
delay(1);
P0 = 0x33;
delay(1);

}

void delay(unsigned int value)
{
unsigned int x,y;
for(x=0;x<200;x++)
for(y=0;y<value;y++);
}


Can anybody help me plz?

List of 2 messages in thread
TopicAuthorDate
Stepper Motor            01/01/70 00:00      
   See this link            01/01/70 00:00      

Back to Subject List