完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
#include
#include ***it weix=P2^1; ***it duanx=P2^0; liushui(); unsigned char q; unsigned char temp,a; unsigned char shi,ge,aa,temp; unsigned char q; unsigned char tmp,a; unsigned char code table[]={ 0x3f,0x06,0x5b,0x4f, 0x66,0x6d,0x7d,0x07, 0x7f,0x6f,0x77,0x7c, 0x39,0x5e,0x79,0x71}; void inint(); delay(); void displar( unsigned char shi, unsigned char ge); delay() { unsigned char i,j,k; for(i=2;i>0;i--) for(j=2;j>0;j--) for(k=158;k>0;k--); } delay1() { unsigned char a,b,c; for (a=20;a>0;a--) for (b=20;b>0;b--) for (c=98;c>0;c--); } main() { inint(); while(1) { if(aa==20) { aa=0; liushui(); temp++; if(temp==61) { temp=0; } shi=temp%61/10; ge=temp%10; } displar(shi,ge); } } void inint() { TMOD=0x01; TH0=(65536-50000)/256; TL0=(65536-50000)%256; EA=1; ET0=1; TR0=1; } void displar(unsigned char shi, unsigned char ge) { weix=1; P0=0xfd; weix=0; duanx=1; P0=table[shi]; duanx=0; delay(); weix=1; P0=0xfb; weix=0; duanx=1; P0=table[ge]; duanx=0; delay(); } void zd() interrupt 1 { TH0=(65536-50000)/256; TL0=(65536-50000)%256; aa++; } liushui() { P1=0xfe; delay1(); P1=0xfc; delay1(); P1=0xf8; delay1(); P1=0xf0; delay1(); P1=0xe0; delay(); P1=0xc0; delay(); P1=0x80; delay(); P1=0x00; delay1(); } |
|
相关推荐 |
|
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-29 15:20 , Processed in 0.587843 second(s), Total 45, Slave 33 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号