0
4.2kviews
Write 89C51 C language program to rotate stepper motor by 180 degree in clockwise direction motor has step angle 1.8 degree. Use stepper motor of 4 step pulse sequence.
1 Answer
0
123views

enter image description here

Step Angle= $1.8^0$

Total steps required= 180 /1.8=100

#include < reg51.h >

#define stepper P1

void delay (unsigned int);

void main ()

{

    Unsigned int i;

    for (i=1; i <=25;i++)

    {

        stepper = 0X0C;

        delay (10);

        stepper = 0X06;

        delay (10);

        stepper = 0X03;

        delay (10);

        stepper = 0X09;

        delay (10);

    }

}

void delay (unsigned int k)

{
    unsigned int x, y;

    for(x=0; x< k; x++)

    for (y=0; y<1275; y++);

}
Please log in to add an answer.