欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標題: ds12887仿真顯示為什么不走 求幫助 [打印本頁]

作者: 高占國    時間: 2021-3-9 13:49
標題: ds12887仿真顯示為什么不走 求幫助
#include<reg51.h>
#define uchar unsigned char
#define uint unsigned int
sbit e=P2^0;
sbit rw=P2^1;
sbit rs=P2^2;
sbit sas=P2^6;
sbit srw=P3^6;
sbit scs=P2^7;
sbit sds=P3^7;
uchar fen,shi,miao;
void yanshi(uint x)
{
        uchar y,s;
        for(y=x;y>0;y--)
        for(s=110;s>0;s--);
}
void zhiling(uchar x)
{
        rs=0;
        rw=0;
        e=0;
        P1=x;
        yanshi(5);
        e=1;
        yanshi(5);
        e=0;
}
void shuju(uchar x)
{
        rs=1;
        rw=0;
        e=0;
        P1=x;
        yanshi(5);
        e=1;
        yanshi(5);
        e=0;
}
void chushi()
{
        zhiling(0x38);
        zhiling(0x0c);
        zhiling(0x06);
        zhiling(0x80);
        zhiling(0x01);
        zhiling(0x80+0x40+11);
        shuju(':');        
        zhiling(0x80+0x40+8);
        shuju(':');               
                                
}
void msf(uchar x,y)
{
        uchar ge,shi;
        ge=x%10;
        shi=x/10;
        zhiling(0x80+0x40+y);
        shuju(0x30+shi);
        shuju(0x30+ge);
}
void xieshi(uchar x,y)//寫ds12887
{
        scs=0;
        srw=1;
        sds=1;
        sas=1;
        P0=x;
        sas=0;
        srw=0;
        P0=y;
        srw=1;
        sas=1;
        scs=1;

}
uchar dushi(uchar x)  //讀12887
{                                 
        uchar y;
        scs=0;
        srw=1;
        sds=1;
        
        sas=1;
        P0=x;
        sas=0;
        sds=0;
        P0=0xff;
        y=P0;
        sds=1;
        sas=1;
        scs=1;
        return y;               
}

void main()
{
        chushi();
        xieshi(0x0b,0x02);
        xieshi(0x0a,0x20);
        while(1)
        {
                miao=dushi(0);
                fen=dushi(2);
                shi=dushi(4);
                msf(miao,12);        
                msf(fen,9);            
                msf(shi,6);

        }
}                                          


作者: 高占國    時間: 2021-3-9 13:53
小弟選謝謝了,




歡迎光臨 (http://www.raoushi.com/bbs/) Powered by Discuz! X3.1