普中单片机开发板HC6800EM3-V22,用杜邦线把JP3与JP10、J12和JP11连接;下载程序后D17和D18LED灯不规律闪亮!!!
#include <reg51.h>
void delay(unsigned int i);
unsigned char code LED7Code[] = {~0x3F,~0x06,~0x5B,~0x4F,~0x66,~0x6D,
~0x7D,~0x07,~0x7F,~0x6F,~0x77,~0x7C,~0x39,~0x5E,~0x79,~0x71};
main()
{
unsigned int LedNumVal ;
EA=1;
EX0=1;
while(1)
{
LedNumVal++;
P2=0x00;
P0 = LED7Code[LedNumVal%16]&0x7f;
delay(62000);
}
}
void inte () interrupt 0
{
P2=0x03;
}
void delay(unsigned int i)
{
char j;
for(i; i > 0; i--)
for(j = 200; j > 0; j--);
}
普中单片机开发板HC6800EM3-V22,用杜邦线把JP3与JP10、J12和JP11连接;下载程序后D17和D18LED灯不规律闪亮!!!本想尝试一下中断程序,可是发现LED灯不规律闪动,头疼ing
请问这是什么原因呢?
|