求两位数码管显示一个倒数时间的单片机程序,比如显示从99到0
//双 - 二吉特数字管指示9 9 〜00,而微控制器5 1 #include // Countdown#defineuintunsigned#defineucharunsigncharuchacodetable [] 0x6 6 .0x6 d,0x7 d,0x07 .0x7 f,0x6 f,0x7 7 .0x7 c,0x3 9 .0x5 e,0x7 d}; Ucharbai,雨; uinta1 ,a2 ; sbitd1 = p3 ^0; //位select 1 p1 端口段代码sbitd2 = p3 ^1 ; //位select 2 sbitkey = p3 ^7 ; // start/bit lits; voidmain(){tmod = 0x01 ; th0 =(6 5 5 3 6 -1 0000)/2 5 6 ; TL0 =(6 5 5 3 6 -1 0000)%2 5 6 ; EA = 1 ; ET0 = 1 ; tr0 = 1 ; bai = 0; 雨= 0; 而(1 ){if(key == 0){o}}} voidTimer0()drivent1 {th0 =(6 5 5 3 6 -1 0000)/2 5 6 ; TL0 = 6 5 5 3 6 -1 0000)%2 5 6 ; A1 ++; y = 〜y; if(a1 == 1 00){a1 = 0; if(key == 1 )a2 -; if(a2 > = 1 00)a2 = 9 9 ;} d1 = 1 ; d2 = 1 ; if(y == 1 ){p1 = table [a2 /1 0]; D1 = 0;
怎样用51单片机实现累加计时和倒计时,并用六个共阴极数码管显示出来。
用两个按键分别切换。
#include [] = {0xc0,0xf9 ,0xa4 ,0xb0,0x9 9 ,0x9 9 2 ,0x8 2 ,0x8 2 ,0x5 ,0xf8 ,0x8 0,0x9 0,0x9 0,0x8 3 ,0x8 3 ,0x6 c6 c6 c6 ,0xc6 ,0xc6 ,0x6 ,0xc6 ,0xcccc6 ,0xCccccccccccccccccc8 6 ,0xcc8 6 ,cccc8 6 ,cccc6 ,cc. Astrust -signedDisdat [6 ]; 有点upbit; sbitKeyu = p3 ^0; sbitKeyd = p3 ^1 ; vouddelay(未组合) 点[3 ] =分钟%1 0; ur/1 0; 5 9 ){小时++; (模式== 0)(小时> 2 3 )小时= 0; 在5 9 -}}}}}}} = 0x02 ; b [5 ] disdat [1 ]小时= 0; 1 ;
AT89C51单片机60.00到00.00倒计时程序 4位数码管显示 C语言 自己没做出来,急用,万分感谢
#include #defineucharunsignedchar sbitdula = p2 ^6 ; //段选择,位选择和位选择; x6 f}; //正常的负数字管voiddisplay(UCH)ARB,UCHARA); vooddelay1 ms(); voidmain(){tmod = 0x01 ; // inlatize th0 =(6 5 5 3 6 -5 0000)/2 5 6 ; (1 ){if(t == 2 0)// decment 1 {t = 0; num-; b = num/1 0; a = num%1 0; if(num == 0)num = 6 0;} perfor(b,a); , 对于(y = 0; y <5 0; y ++);} voddispl ay(ucharb,uchara)//动态显示零件{dula = 1 ; p0 =表[b]; dula = 0; vela = 0; vela = 1 ; p0 = 0xfe; vela = 0; p0 = 0xff; 延迟1 ms(); dula = 1 ; 它相对简单,主要地方有评论。
你取得成功! 你
51单片机两个阳极数码管显示24倒计时怎么显示00
C语言5 1 微控制器数字管计数器基于5 1 个微控制器总数数字数字管显示(2 -空间收集器)掉落”,请在在线安装图中找到。
0x0x5 b,0x4 f,0x6 1 ,d2 ,g,y)tmod = 0x01 ;