国产免费AV|泡泡玛特欧洲总部将设在伦敦|中文天堂网www新版资源在线|一本久道综合在线中文|国精产品一二三产区的使用方法|香蕉鱼在线观看|www.27eee

 找回密碼
 注冊
搜索

9999倒計時AT89C51單片機

[復制鏈接]
樓主
coolice 發表于 2020-2-1 23:12:18 | 只看該作者 |只看大圖 |倒序瀏覽 |閱讀模式
這只是一部分,全部請下載文件
#include<reg51.h>
#include<intrins.h>
#define uchar unsigned char
#define uint unsigned int
uchar code tab[10]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
uint sec=9999;
void delayms(uint z)
{
        uint x,y;
        for(x=z;x>0;x--)
            for(y=110;y>0;y--);
}
void display(sec)
{
        P2=0xf7;
        P0=tab[sec%10];
        delayms(7);
        P2=0xfb;
        P0=tab[sec%100/10];
        delayms(7);
        P2=0xfd;
        P0=tab[sec%1000/100];
        delayms(7);
        P2=0xfe;
        P0=tab[sec/1000];
        delayms(7);
}
void main()
{
    TMOD=0x10;
        TH1=-46082/256;
        TL1=-46082%256;
        EA=1;
        ET1=1;
        TR1=1;
        while(1) {display(sec);}
}
9999倒計時AT89C51單片機 1.png
9999倒計時.zip (46.44 KB, 售價: 1 E幣)

您需要登錄后才可以回帖 登錄 | 注冊

本版積分規則

手機版|小黑屋|ELEOK |網站地圖

GMT+8, 2026-5-26 02:12

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回復 返回頂部 返回列表