#include
#define uint unsigned int
#define uchar unsigned char
#define N z[60] //X速度
#define M z[61] //Y速度
//#define zil 54]*256+z[55]
unsigned char code Z1[8]={0x01,0x03,0x02,0x06,0x04,0x0c,0x08,0x09}; // 正转
//unsigned char code F1[8]={0x09,0x08,0x0c,0x04,0x06,0x02,0x03,0x01}; //反转
sbit jg=P2^0;
sbit EN1=P2^7;
sbit EN2=P2^6;
sbit EN3=P2^5;
sbit EN4=P2^4;
sbit led=P2^1;//指示灯
uchar xdata z[500]={0};//缓存
uchar buff[3];//串口缓存
uchar x1,x0,y1,y0,cont2=0;
uchar xfb=4,yfb=4;//走步标志位
uchar x,y,k,temp,t;//变量定义,有些没有用
char i,j;
uint h=0,jiguang;
void delayms(uint xms)
{
uint i,j;
for(i=xms;i>0;i--) //i=xms即延时约xms毫秒
for(j