#include<reg51.h>
#define uint unsigned int; uint k;
sbit D1=P1^0;
uint k;
void main(void)
{uint k=0;TMOD=0x20;
while(1){while(!TF1);TF1=0;
while(++==2000){D1=!D1;k=0;}}}
START: JB P1.0, NEXT1 ;P1.0=0,左转灯亮
SETB P1.7
CLR P1.6
ACALL DELAY
SETB P1.6
ACALL DELAY
NEXT1: JB P1.1,NEXT2 ;P1.1=0,右转灯亮
SETB P1.6
CLR P1.7
ACALL DELAY
SETB P1.7
ACALL DELAY
NEXT2: SETB P1.6 ;P1.0=1、P1.1=1转向灯熄灭
SETB P1.7
SJMP START
;延时500ms
DELAY: MOV R1,#5
L1: MOV R2,#200
L2: MOV R3,#250
DJNZ R3,$
DJNZ R2,L2
DJNZ R1,L1
RET
END
错误是TEXT4.C(5): error C129: missing ';' before 'k' 怎么改啊
|