標(biāo)題: 解讀這段程序,是數(shù)碼管的。標(biāo)注每一句的意思 [打印本頁(yè)]
作者: 緣分的天空 時(shí)間: 2014-6-21 07:28
標(biāo)題: 解讀這段程序,是數(shù)碼管的。標(biāo)注每一句的意思
#include <AT89X51.H>
unsigned char code table[]={0x00,0x01,0x02,0x03,0x04,
0x05,0x06,0x07,0x08,0x09,0x0A};
unsigned char discount,discount2;
void delay02s(void) //延時(shí)
{
unsigned char i,j,k;
for(i=20;i>0;i--)
for(j=20;j>0;j--)
for(k=248;k>0;k--);
}
void main(void)
{
int a=0;
int b=0;
discount=0;
discount2=0;
P1=discount;
while(1)
{
if(discount==10)
{
discount=0;
discount2++;
if(discount2==10)
{
discount2=0;
discount=0;
}
b=table[discount2];
b=b*16;
P1=P1|b;
b=b|0x0F;
P1=P1&b;
}
a=table[discount];
P1=P1|a;
a=a|0xf0;
P1=P1&a;
discount++;
if(discount2==10)
{
discount2=0;
discount=0;
}
delay02s();
作者: sz1001 時(shí)間: 2014-7-9 15:45
樓主是求解讀還是解讀?求的話要說求的啊,不然人家怎么知道你要~~
作者: 黑鴉的泣靈 時(shí)間: 2014-7-16 18:32
需要硬件電路
歡迎光臨 (http://www.torrancerestoration.com/bbs/) |
Powered by Discuz! X3.1 |