0
Write C language program to rotate stepper motor by 90 degree clockwise. Assume step angle is 1.8 degree and 4 step sequence.
c program • 2.2k  views
0
0

Step angle=1.8 degree
Total steps required=90/1.8=50
Four step sequence so
Count=50/4=12.5=approximately 13

#include< regx51.h>  
 void delay();  
void main()  
{
    int x;  
    for (x=0;x,13;x++)  
    { 
        P0=0x33;  
        delay(10);  
        P0=0x66;  
        delay(10);  
        P0=0xcc   
        delay(10);  
        P0=0x99;  
        delay(10);  
    }  
}  
void delay(unsigned int t)  
{
    unsigned int x,y;  
    for(x=0;x<=t;x++)  
    for(y=0;y<=1275;y++);  
}
0
Please log in to add an answer.

Continue reading

Find answer to specific questions by searching them here. It's the best way to discover useful content.

Find more