本人在KEIL上编了以下这个程序,编译通过,但烧到单片机以后,插到仿真板上后不运行。请帮忙看一下。 #include<reg52.h> #include<intrins.h> #define uint unsigned int #define uchar unsigned char #define ON 1 #define OFF 0 sbit Lap1=P1^0; sbit Lap2=P1^1; sbit Lap3=P1^2; sbit Lap4=P1^3; sbit Lap5=P1^4; sbit Lap6=P1^5; sbit Lap7=P1^6; sbit Lap8=P1^7; void initial(); void delay(); void main() { initial(); delay(); while(1) { Lap1=ON; delay(); Lap1=OFF; delay();
Lap2=ON; delay(); Lap2=OFF; delay();
Lap3=ON; delay(); Lap3=OFF; delay();
Lap4=ON; delay(); Lap4=OFF; delay();
Lap5=ON; delay(); Lap5=OFF; delay();
Lap6=ON; delay(); Lap6=OFF; delay();
Lap7=ON; delay(); Lap7=OFF; delay();
Lap8=ON; delay(); Lap8=OFF; delay(); } } void initial() { Lap1=OFF; Lap2=OFF; Lap3=OFF; Lap4=OFF; Lap5=OFF; Lap6=OFF; Lap7=OFF; Lap8=OFF; } void delay() { int i=0; while(i<20)i++; } |