久久久噜噜噜久久中文字幕色伊伊-性欧美大战久久久久久久-久久综合狠狠综合久久综合88-老太BBWWBBWW高潮

  熱門關鍵詞:
led時鐘的設計
  • 該文件為docx格式
  • 文件大小:95.27 KB
  • 下載次數
  • 文件評級
  • 更新時間:2020-01-11
  • 發 布 人77777x
  • 文件下載:
  • 立即下載

  • 文件介紹:
  • 該文件為 docx 格式,下載需要 1 積分
  • 實驗3#include
    #include
    #include
    #define uchar unsigned char
    #define uint unsigned int
    #define out P0
    sbit RS=P3^0;
    sbit RW= P3^1;
    sbit E=P3^2;
    uchar int_time;
    uchar second;
    uchar minute;
    uchar hour;
    uchar code date[]=" H.I.T. CHINA ";
    uchar code time[]="TIME 23:59:55 ";
    uchar second =55,minute = 59,hour = 23;
    void check_busy(void)
    {
    uchar dt;
    do
    {
    dt = 0xff;
    E=0;
    RS=0;
    RW=1;
    E=1;
    dt= out;
    }while(dt&0x80);
    E=0;
    }

    void delay(uint j)
    {
    uchar i =250;
    for(;j>0;j--)
    {
    while(--i);
    i=249;
    while(--i);
    i=250;
    }
    }

    void write_com(uchar com)
    {
    check_busy();
    E=0;
    RS=0;
    RW=0;
    out= com;
    E=1;
    _nop_();
    E=0;
    delay(1);
    }

    void write_data(uchar dat)
    {
    check_busy();
    E=0;
    RS=1;
    RW=0;
    out=dat;
    E=1;
    _nop_();
    E=0;
    delay(1);
    }

    void write_sfm(uchar add,uchar date)
    {
    uchar shi,ge;
    shi=date/10;
    ge=date%10;
    write_com(0x80+0x40+add);
    write_data(0x30+shi);
    write_data(0x30+ge);
    }

    void clock_init()
    {
    uchar i,j;
    for(i=0;i<16;i++)
    {
    write_data(date[i]);
    }
    write_com(0x80+0x40);
    for(j=0;j<16;j++)
    {
    write_data(time[j]);
    }
    }

    void clock_write(uint s,uint m,uint h)
    {
    write_sfm(0x47,h);
    write_sfm(0x4a,m);
    write_sfm(0x4d,s);
    }

    void main()
    {
    init1602();
    clock_init();
    TMOD=0x01;
    EA=1;
    ET0=1;
    TH0=(65536-15536)/256;
    TL0=(65536-15536)%256;
    TR0=1;
    int_time=0;
    second=55;
    minute=59;
    hour=23;
    while(1)
    {
    clock_write(second,minute,hour);
    }
    }
    ...
文檔留言
驗證碼: 請在右側輸入驗證碼 看不清楚,換一個
更多..相關文檔
    無相關信息