《单片机60秒倒计时程序文件.docx》由会员分享,可在线阅读,更多相关《单片机60秒倒计时程序文件.docx(2页珍藏版)》请在三一办公上搜索。
单片机60秒倒计时程序文件#include #define uchar unsigned char #define uint unsigned int uchar code table= 0x3f,0x06,0x5b,0x4f, 0x66,0x6d,0x7d,0x07, 0x7f,0x6f,0x77,0x7c, 0x39,0x5e,0x79,0x71; uchar tt,shuz,shi,ge; main void fenli; TMOD=0x01; EA=1; ET0=1; TH0=(65536-50000)/256; TL0=(65536-50000)%256; shuz=60; P2=0xfc; TR0=1; while(1) P2=0xfe; P0=tableshi; if(tt=20) tt=0; shuz-; if(shuz=60) shuz=0; fenli; P2=0xfd; P0=tablege; if(tt=20) tt=0; shuz-; if(shuz=60) shuz=0; fenli; void time0 interrupt 1 TH0=(65536-50000)/256; TL0=(65536-50000)%256; tt+; void fenli shi=shuz/10; ge=shuz%10;