#include<reg52.h>
#define uchar unsigned char
#define uint unsigned int
sbit FREE=P2^1;
sbit CP=P2^2;
sbit DIR=P2^3;
sbit key=P1^0;
void delay()
{
uint y;
for(y=114;y>0;y--)
;
}
void main()
{
uint i = 0;
FREE=0;
CP=0;
DIR=1;
key=1;
while(1)
{
if(key==0)
{
FREE=1;
i=400;
while(i--)//循环400次
{
CP=1;
delay();
CP=0;
delay();
}
FREE=0;//脱机
}
}
}