中文字幕 另类精品,亚洲欧美一区二区蜜桃,日本在线精品视频免费,孩交精品乱子片免费

<sup id="3hn2b"></sup>

    1. <sub id="3hn2b"><ol id="3hn2b"></ol></sub><legend id="3hn2b"></legend>

      1. <xmp id="3hn2b"></xmp>

      2. 新聞中心

        EEPW首頁(yè) > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 單片機(jī)+1602液晶數(shù)字時(shí)鐘程序

        單片機(jī)+1602液晶數(shù)字時(shí)鐘程序

        作者: 時(shí)間:2016-12-01 來源:網(wǎng)絡(luò) 收藏
        本程序由好幾個(gè)頭文件組成,都在下面,你可以復(fù)制代碼并保存為獨(dú)立的文件

        頭文件STC12C5A.H下載:http://www.51hei.com/mcu/2564.html

        程序:
        首先是主程序:
        #include
        #include "STDIO.h"
        #include "LCD1602.h"
        #include "interrupt.h"

        本文引用地址:http://www.antipu.com.cn/article/201612/324578.htm

        void main()
        {
        LCD_init();
        interrupts_init();
        LCD_disp_cher(0, 1,"784729514 ");
        while(1)
        {
        sprintf(dsa,"%d:%d:%d ",hour,minute,sec);
        LCD_disp_cher(0,2,dsa);
        }
        }

        下面是lcd1602.H頭文件:http://www.51hei.com/mcu/2965.html

        這是另一個(gè)頭文件 自行保存即可
        #ifndef _interrupt_H_
        #define _interrupt_H_
        #define uint unsigned int
        #define uchar unsigned char
        uint sec,subtle,minute,hour;
        uchar dsa[16];
        void interrupts_init()
        {
        EA=1;
        ET0=1;
        TR0=1;
        TMOD=0x1;
        TH0=(65536-50000)/255;
        TL0=(65536-50000)%255;
        }
        void ghjfgf() interrupt 1
        {
        TH0=(65536-50000)/255;
        TL0=(65536-50000)%255;
        subtle++;
        if(subtle==20)
        {
        subtle=0;
        sec++;
        }
        if(sec==60)
        {
        sec=0;
        minute++;
        }
        if(minute==60)
        {
        minute=0;
        hour++;
        }
        if(hour==24) hour=0;
        }
        #endif



        評(píng)論


        技術(shù)專區(qū)

        關(guān)閉