Write a progarm for half stepper motor to rotate clockwise.


#include<8051.h>
void delay(unsigned int i)
{
while(i!=0)
{
i–;
}
}
void main()
{
while(1)
{
P0_0=1,P0_1=0,P0_2=0,P0_3=0;
delay(10000);
P0_0=0,P0_1=1,P0_2=0,P0_3=0;
delay(10000);
P0_0=0,P0_1=0,P0_2=1,P0_3=0;
delay(10000);
P0_0=0,P0_1=0,P0_2=0,P0_3=1;
delay(10000);
}
}

Add Comment