Microcontroller › 8051 › stepper interface to 8051 › #include #include
March 4, 2012 at 3:25 pm
#7243
Naveen Srivastava
Participant
#include <stdio.h>
#include <8051.h>
void delay (int time)
{
int i,j;
for (i=0;i<=10;i++)
{
for (j=0;j<=time*10;j++)
{
}}}
void forward ( )
{
P1=0x11;
delay(10);
P1=0x22;
delay(10);
P1=0x33;
delay(10);
P1=0x44;
delay(10);
}
void main()
{
P1=0xff;
while(1)
{
forward();
}
}