user-0 提问: 有没有带佬看看这是哪有问题啊

回复:
user: user-1
content: delay 200ms； 这样的语句改成 delay（200）；  自己对照错误提示，告诉你了在哪些行，对应的改就是了

user: user-0
content: 引用 2 楼 寻开心的回复:第九行和第八行的变量名字重复了， 改变量名字，或者删除 其中的一行 谢谢大佬。。。。。。

user: user-0
content: #include<reg52.h> #define uchar unsigned char #define uint unsigned int #define Motordata                              sbit zheng = P3^0; sbit fan = P3^1; sbit stop = P3^2; uchar phaswcw[8]={0x01,0x03,0x02,0x06,0x04,0x0c,0x08,0x09};   //四相八拍正转编码  uchar phaswcw[8]={0x09,0x08,0x0c,0x04,0x06,0x02,0x03,0x01}; uchar stepd[]={0x01,0x03,0x02,0x06,0x04,0xc0,0x08,0x09}; 	  //四相八拍反转编码 uchar num=0,fx=0;  uchar kaiguan,motorzhiliu,delay,jiance,ledred,ledgreen; uchar motorkapan; uchar motortuigan; uchar duoji; uchar ms; uchar jd=67;   //按数组的控制方式步距角为0.9度，所以60度约需要67步  sbit key1=P1^0;  sbit key2=P1^1;  sbit key3=P1^2;  a=1; void main() { if (kaiguan == 0) {  delay 200ms; motorzhiliu = motorkapan = motortuigan = duoji= 0;      ledred = ledgreen = 0;    } if (kaiguan == 1)  {   delay 100ms;   ledred = 1;   motorzhiliu = 1;   //执行舵机的子程序 delay 200ms;   motorkapan;  }  } //Motorkapan的子程序 {   if (a = 1);    delay 100ms; //motorkapan旋转60°；   delay 300ms;   { if (jiance = 1)                                            //检测是否有销钉；  {   ledred = 0;   ledgreen = 1;   motortuigan;     a = 0; if (a = 0); //执行舵机的子程序  } else(jiance = 0)   motorkapan;  } } void motortuigan(void) {   motorzhengfanzhuan;   ledred = 1;   ledgreen = 0;   delay 200ms; }  //舵机子程序 void delay(uint t) {   uint k;   while(t--)   {    for(k=0; k<122 k++)   } } void Delay_xms(unit x) { uint i,j;     { for(i=0; i<x; i++) for(j=0;j<122;j++)    } } //顺时针转动 void motor_work (uint t) { uchar i;j; switch(t) { case 0; while(1) { if(stop = 0)     break;   for(j=0;j<8;j++)    {      motordata = phaseccw[j];      delay(50);                          //转速调节 } } break; } }                                        //停止转动 void? motor_test(void)  {  if(zheng = 0) { delay_xms(10); Motor_work(0); } if(fan = 0) { delay_xms(10); motor_work(1); } } //步进电机正反转主程序 void motorzhengfanzhuan(void) { Delay_xms(10);//等待系统稳定 while(1) {     motor_test();  } }

user: user-0
content: #include<reg52.h> #define uchar unsigned char #define uint unsigned int #define Motordata                              sbit zheng = P3^0; sbit fan = P3^1; sbit stop = P3^2; uchar phaswcw[8]={0x01,0x03,0x02,0x06,0x04,0x0c,0x08,0x09};   //四相八拍正转编码  uchar phaswcw[8]={0x09,0x08,0x0c,0x04,0x06,0x02,0x03,0x01}; uchar stepd[]={0x01,0x03,0x02,0x06,0x04,0xc0,0x08,0x09}; 	  //四相八拍反转编码 uchar num=0,fx=0;  uchar kaiguan,motorzhiliu,delay,jiance,ledred,ledgreen; uchar motorkapan; uchar motortuigan; uchar duoji; uchar ms; uchar jd=67;   //按数组的控制方式步距角为0.9度，所以60度约需要67步  sbit key1=P1^0;  sbit key2=P1^1;  sbit key3=P1^2;  a=1; void main() { if (kaiguan == 0) {  delay 200ms; motorzhiliu = motorkapan = motortuigan = duoji= 0;      ledred = ledgreen = 0;    } if (kaiguan == 1)  {   delay 100ms;   ledred = 1;   motorzhiliu = 1;   //执行舵机的子程序 delay 200ms;   motorkapan;  }  } //Motorkapan的子程序 {   if (a = 1);    delay 100ms; //motorkapan旋转60°；   delay 300ms;   { if (jiance = 1)

user: user-1
content: 第九行和第八行的变量名字重复了， 改变量名字，或者删除 其中的一行

user: user-1
content: 第九行和第八行一模一样，变量重复定义了，删除第九行 后面错误在26行看不到，贴源码文本格式贴