Home > other >  Everyone a great god I want to give in motor rotate a lap to stop but when simulation step motor to
Everyone a great god I want to give in motor rotate a lap to stop but when simulation step motor to

Time:09-16

This is my source code
# include
# define uchar unsigned char
# define uchar unsigned int
Char table []={0 x08, 0 x0c, 0 x04, 0 x06, 0 x02, 0 x03, 0 x01, 0 x09};//is
Void delay ()//delay program
{
Uchar a, b;
For (a=0; a<150; +)
For (b=0; B<112; B++);
}
Void main ()
{
Uchar I, j;
for(i=0; i<8; I++) {
P1=table [I];//motor forward
delay();
}
}
This is the circuit diagram

CodePudding user response:

What kind of test your motor turned a few rounds?

CodePudding user response:

reference 1/f, worldy response:
what kind of test your motor turned a few rounds?


Proteus simulation when see stepping motor has been rotating

CodePudding user response:

Add a while after the for loop infinite loop, otherwise the program repeated executions in

CodePudding user response:

# include
# define uchar unsigned char
# define uchar unsigned int
Char table []={0 x08, 0 x0c, 0 x04, 0 x06, 0 x02, 0 x03, 0 x01, 0 x09};//is
Void delay ()//delay program
{
Uchar a, b;
For (a=0; a<150; +)
For (b=0; B<112; B++);
}
Void main ()
{
Uchar I, j;
for(i=0; i<8; I++) {
P1=table [I];//motor forward
delay();
}
while(1);
}


After turn a circle, don't move on, simple and crude

CodePudding user response:

Drive COM grounded?
  • Related