菜鸟初学者 求帮忙~~感激不尽~~
#include<reg52.h>
unsigned char code table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};
unsigned char num,tt;
sbit dula=P2^0;
sbit wela=P2^1;
void main()
{ num=0;
tt=0;
TMOD=0x01;
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
EA=1;
ET0=1;
TR0=1;
wela=1;
P0=0xc0;
wela=0;
dula=1;
P0=0x3f;
dula=0;
while(1)
{
if(tt==20)
{
tt=0;
num++;
if(num==15)
num=0;
dula=1;
P0=table[num];
dula=0;
}
}
}
void exter() interrupt 1
{
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
tt++;
}
#include<reg52.h>
unsigned char code table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};
unsigned char num,tt;
sbit dula=P2^6;
sbit wela=P2^7;
void main()
{ num=0;
tt=0;
TMOD=0x01;
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
wela=1;
P0=0x00;
wela=0;
dula=1;
P0=0x3f;
dula=0;
EA=1;
ET0=1;
TR0=1;
while(1)
{
if(tt==20)
{
tt=0;
num++;
if(num==15)
num=0;
P0=0xff;
dula=1;
P0=table[num];
dula=0;
}
}
}
void exter() interrupt 1
{
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
tt++;
}
你看一下 你的板子上的原理图 看看573的片选端是不是 sbit dula=P2^0;
sbit wela=P2^1; 我在自己的板子上试了我更改过的程序 木有问题啊
恩啊 改成sbit dula=P2^6; sbit wela=P2^7;就可以了~ 不过我看我的板子的原理图表示的锁位器连接的是P2^0和P2^1啊。难道错了么==