下面程序用kell编译能过 在STC烧板却没有任何反应。求高手指点:
#include<reg52.h>sbitkg1=P2^7;sbitkg2=P2^6;sbitkg3=P2^5;sbitkg4=P2^4;voidmain(){voidd...
#include<reg52.h>
sbit kg1=P2^7;
sbit kg2=P2^6;
sbit kg3=P2^5;
sbit kg4=P2^4;
void main()
{
void delay(int n);
int table[]={0x03,0x9f,0x25,0x0d,0xb1,0x49,0x41,0x1f,0x01,0x09};
int i,j;
kg1=0;
kg2=0;
kg3=0;
kg4=0;
while(1)
{
for(j=0;j<10;j++)
{ kg1=1;
kg2=0;
for(i=0;i<0;i++)
{
P0=table[i];
kg1=0;
kg2=1;
P0=table[j];
delay(500);
}
}
}
}
void delay(int n)
{
int i,j;
for(i=0;i<n;i++)
for(j=0;j<110;j++);
} 展开
sbit kg1=P2^7;
sbit kg2=P2^6;
sbit kg3=P2^5;
sbit kg4=P2^4;
void main()
{
void delay(int n);
int table[]={0x03,0x9f,0x25,0x0d,0xb1,0x49,0x41,0x1f,0x01,0x09};
int i,j;
kg1=0;
kg2=0;
kg3=0;
kg4=0;
while(1)
{
for(j=0;j<10;j++)
{ kg1=1;
kg2=0;
for(i=0;i<0;i++)
{
P0=table[i];
kg1=0;
kg2=1;
P0=table[j];
delay(500);
}
}
}
}
void delay(int n)
{
int i,j;
for(i=0;i<n;i++)
for(j=0;j<110;j++);
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询