请高手帮我翻译下以下程序 这个一个关于数字频率计设计的程序 我就30分了都奉送了

来源:百度知道 编辑:UC知道 时间:2024/05/31 07:17:46
完整代码:
#include <AT89X51.H>
#include <math.h>
unsigned char code dispbit[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
unsigned char code dispcode[]={0x3f,0x06,0x5b,0x4f,0x66,
0x6d,0x7d,0x07,0x7f,0x6f,0x00,0x40};
unsigned char dispbuf[8]={0,0,0,0,0,0,0,0};
unsigned char temp[8];
unsigned char dispcount;
unsigned char T0count;
unsigned int timecount;
bit flag;
unsigned long x;

void main(void)
{
unsigned char i;
unsigned int j;
TMOD=0x15;
TH0=0;
TL0=0;
TH1=(65536-2000)/256;
TL1=(65536-2000)%256;
TR1=1;
TR0=1;
ET0=1;
ET1=1;
//PT0=1;
EA=1;

while(1)
{ P1=dispcode[dispbuf[dispcount]];
P2=dispbit[dispcount];
dispcount++;
if(dispcount==8)
{
dispcount=0;
}
for(j=300;j>0;j--

看不懂,我觉得这种题你要问专业的人比较好

#include <AT89X51.H>
#include <math.h>
unsigned char code dispbit[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f}; //八进制数组,显示的像素
unsigned char code dispcode[]={0x3f,0x06,0x5b,0x4f,0x66,
0x6d,0x7d,0x07,0x7f,0x6f,0x00,0x40}; //八进制数组,服务
unsigned char dispbuf[8]={0,0,0,0,0,0,0,0}; //定义八位数组
unsigned char temp[8];
unsigned char dispcount;
unsigned char T0count;
unsigned int timecount;
bit flag;
unsigned long x;

void main(void) //主函数,执行功能
{
unsigned char i;
unsigned int j;
TMOD=0x15;
TH0=0;
TL0=0;
TH1=(65536-2000)/256; //
TL1=(65536-2000)%256; //取模
TR1=1;
TR0=1;
ET0=1;
ET1=1;
//PT0=1;
EA=1;

while(1) //通过循环获得
{ P1=dispcode[dispbuf[dispcount]];
P2=dispbit[dispcount];
dispcount++;
if(dispcount==8)
{
dispcount=0;
}
for(j=300;j>0;j--);
whil