帮忙看下

[复制链接]
2597|3
 楼主| haoge1388645 发表于 2009-11-11 07:34 | 显示全部楼层 |阅读模式
本帖最后由 haoge1388645 于 2009-11-11 08:13 编辑

#include
unsigned char code table[]={0x3f,0x06,0x5b,0x4f,0x66,
0x6d,0x7d,0x07,0x7f,0x6f};
unsigned char Second;

void delay1s(void)
{
unsigned char i,j,k;
for(k=100;k>0;k--)
for(i=20;i>0;i--)
for(j=248;j>0;j--);
}


void main(void)
{
Second=0;
P0=table[Second/10];  这两句可以改为 P0=table[0];
P2=table[Second%10];                 P2=table[0];   吗
while(1)
{
delay1s();
Second++;
if(Second==60)
{
Second=0;
}
P0=table[Second/10];     

P2=table[Second%10];                 }
}
{
Second=0;
}
P0=table[Second/10];
P2=table[Second%10];
}
}
duojinian 发表于 2009-11-11 12:17 | 显示全部楼层
zhenxing2000 发表于 2009-11-11 16:29 | 显示全部楼层
这应该是分离十位跟个位吧,感觉有问题。
原野之狼 发表于 2009-11-11 22:44 | 显示全部楼层
可以 但是可读性变差了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

3

主题

5

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部