Writ e a Embedded C code for
Stepper Motor Interface ARM Processor.
#include<nxp/iolpc2148.h>
void
delay_ms();
void
main()
{
IO0DIR=0x000000F0;
while(1)
{
IO0PIN = 0X00000090;
delay_ms();
IO0PIN = 0X00000050;
delay_ms();
IO0PIN = 0X00000060;
delay_ms();
IO0PIN = 0X000000A0;
delay_ms();
}
}
void
delay_ms()
{
int i,j;
for(i=0;i<0x0a;i++)
for(j=0;j<750;j++);
}
0 comments:
Post a Comment