单片机做频率计数码管的显示C语言程序
大可爱211
2010-06-19
#include float time=0; float freq=0; unsigned char dsh=0; unsigned char dsz=0; unsigned char dsl=0; main() {EA=1; ET0=1; ET1=1; TMOD=0x061; TH0=-1000/256; TL0=-1000%256; TH1=0xfb; TL1=0xfb; TR0=1; TR1=1; while... #include
float time=0;
float freq=0;
unsigned char dsh=0;
unsigned char dsz=0;
unsigned char dsl=0;
main()
{EA=1;
ET0=1;
ET1=1;
TMOD=0x061;
TH0=-1000/256;
TL0=-1000%256;
TH1=0xfb;
TL1=0xfb;
TR0=1;
TR1=1;
while(1);
}
void freqint(void) interrupt 3 using 1
{time=time/5.0;
freq=1.0/time;
dsh=freq/100;
dsz=(unsigned char)freq%100/10;
dsl=(unsigned char)freq%10;
time=0;
}
void timeint(void) interrupt 1 using 1
{TH0=-1000/256;
TL0=-1000%256;
time=time+0.001;
}
但是这个程序还缺少数码管的显示程序:我用的是三位共阴数码管,P0为段码接口,P2是位码接口,敬请各位贤达之士帮我添加数码管的显示C程序啊........万分感谢啊!
全部评论
看下郭天祥的教程,自己就能写出来了
您可能感兴趣的社区主题
评论
选购仪器 上yiqi.com
仪器网络推广
品牌网上传播
长按识别二维码查看信息详情