标题:
求写倒计时程序
[打印本页]
作者:
老大好
时间:
2015-5-13 22:04
标题:
求写倒计时程序
哪位大神帮我写个倒计时的程序,要求从键盘输入,分,秒,,要能暂停,C语言,非常感谢,,把作品发我邮箱
1419214137@qq.com
,
作者:
zerotom
时间:
2015-5-14 10:12
稍微学学单片机句可以做了,网上找找可能有代码的
作者:
xiasheng
时间:
2015-5-14 20:48
用定时器功能做
作者:
xiasheng
时间:
2015-5-14 21:33
网上有的你可以看下
作者:
1229030363
时间:
2015-5-17 08:29
路过.....
作者:
a庚
时间:
2015-5-17 09:54
#include<reg51.h>
sbit dula=P2^6;
sbit wela=P2^7;
#define uchar unsigned char
#define uint unsigned int
uchar j,k,a1,a0,s=60;
uint m;
uchar table[]={0x3f,0x06,0x5b,0x4f,0x66,
0x6d,0x7d,0x07,0x7f,0x6f,0x77,
0x7c,0x39,0x5e,0x79,0x71};
void delay(uchar i)
{
for (j=i;j>0;j--)
for(k=125;k>0;k--);
}
void display(uchar sh,uchar g)
{
P0=0x00;
dula=1;
P0=table[sh];
dula=0;
wela=0;
P0=0xfe;
wela=1;
wela=0;
delay(5);
P0=0x00;
dula=1;
P0=table[g];
dula=0;
P0=0xfd;
wela=1;
wela=0;
delay(5);
}
void time0() interrupt 1
{
TH0=(65536-46080)/256;
TL0=(65536-46080)%256;
m++;
}
void main()
{
TMOD=0x01;
TR0=1;
TH0=(65536-46080)/256;// 我的晶振为11.0592,故所记次数应为46080,
TL0=(65536-46080)%256;
ET0=1;
EA=1;
while(1)
{
if(m==20)
{
m=0;
s--;
}
a0=s%10;
a1=s/10;
display(a1,a0);
if(s==0)
{
TR0=0;
}
}
}
作者:
3234174699
时间:
2015-5-17 10:20
新手飘过...向各位大神学习
欢迎光临 (http://www.51hei.com/bbs/)
Powered by Discuz! X3.1