#include <reg52.h>
#include <intrins.h>
#define uint unsigned int
#define uchar unsigned char
uchar aa,numb,temp;
uint z;
uchar code table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e, 0x79,0x71,0x00};
void delay(uint);
sbit m2=P2^6;
sbit m3=P2^7;
void main()
{
TMOD=0x01;
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
EA=1;
ET0=1;
TR0=1;
m3=1;
P0=0XC0;
m3=0;
m2=1;
P0=table[0];
m2=0;
temp=0xfe;
P1=temp;
aa=0;
numb=0;
while(1)
{
delay(1000);
temp=_crol_(temp,1);
P1=temp;
}
}
void delay(uint z)
{
uint x,y;
for(x=z;x>0;x--)
for(y=110;y>0;y--);
}
void
time_0() interrupt 1
{
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
aa++;
if(aa==40)
{
aa=0;
numb++;
if(numb==16)
numb=0;
m2=1;
P0=table[numb];
m2=0;
}
}
-
C是用protues8.1写的啊,你说的是keil的方法,问题是,器件内存 在 protues里面 也好改,改了没用啊问题是!
那应该怎么办呢?
一周热门 更多>