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

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 2302|回復: 4
收起左側

各位大神有沒有關于液晶動態顯示數字的相關程序 求分享

[復制鏈接]
ID:301821 發表于 2018-4-4 08:40 | 顯示全部樓層 |閱讀模式
各位大神有沒有關于液晶動態顯示數字的相關程序,給小弟參考一下呀!
回復

使用道具 舉報

ID:278892 發表于 2018-4-4 11:32 | 顯示全部樓層
1602的要嗎
回復

使用道具 舉報

ID:278892 發表于 2018-4-4 11:32 | 顯示全部樓層
#include<reg52.h>
#define uchar unsigned char
#define uint unsigned int
sbit lcden=P3^4;
sbit rs=P3^5;
sbit rw=P3^6;       
sbit dula=P2^6;
sbit wela=P2^7;
uchar table1[]="xingming:xxxxxxxxxxxx";
uchar table2[]="xuehao:11111111111  ";
void delay(uint x)
{
        uint a,b;
        for(a=x;a>0;a--)
                for(b=10;b>0;b--);
}

void delay1(uint x)
{
        uint a,b;
        for(a=x;a>0;a--)
                for(b=100;b>0;b--);
}

void write_com(uchar com)   
{
        P0=com;
        rs=0;
        lcden=0;
       
        lcden=1;
       
        lcden=0;
       
}

void write_date(uchar date)
{
        P0=date;
        rs=1;
        lcden=0;
        delay(10);
        lcden=1;
        delay(10);
        lcden=0;
       
}

void init()
{
   rw=0;
        dula=0;
        wela=0;
        write_com(0x38);   //顯示模式設置:16×2顯示,5×7點陣,8位數據接口
        delay(20);
        write_com(0x0c);   //顯示模式設置
        delay(20);
        write_com(0x07);   //顯示模式設置:光標右移,字符不移
        delay(20);
        write_com(0x01);   //清屏幕指令,將以前的顯示內容清除
        delay(20);       
}

void main()
{
        uchar a;
        init();

        write_com(0x80);         
        delay(50);
        for(a=0;a<18;a++)
        {
        write_date(table1[a]);
        delay(40);               
        }

        write_com(0x80+0x40);
        delay(50);
        for(a=0;a<18;a++)
        {
        write_date(table2[a]);
        delay(40);               
        }

        for(a=0;a<16;a++)
        {
                write_com(0x18); //左移
                delay1(1000);
        }
        while(1);
}
回復

使用道具 舉報

ID:278892 發表于 2018-4-4 11:34 | 顯示全部樓層
1602


#include<reg52.h>
#define uchar unsigned char
#define uint unsigned int
sbit lcden=P3^4;
sbit rs=P3^5;
sbit rw=P3^6;       
sbit dula=P2^6;
sbit wela=P2^7;
uchar table1[]="xingming:xxxxxxxxxxxx";
uchar table2[]="xuehao:11111111111  ";
void delay(uint x)
{
        uint a,b;
        for(a=x;a>0;a--)
                for(b=10;b>0;b--);
}

void delay1(uint x)
{
        uint a,b;
        for(a=x;a>0;a--)
                for(b=100;b>0;b--);
}

void write_com(uchar com)   
{
        P0=com;
        rs=0;
        lcden=0;
       
        lcden=1;
       
        lcden=0;
       
}

void write_date(uchar date)
{
        P0=date;
        rs=1;
        lcden=0;
        delay(10);
        lcden=1;
        delay(10);
        lcden=0;
       
}

void init()
{
   rw=0;
        dula=0;
        wela=0;
        write_com(0x38);   //顯示模式設置:16×2顯示,5×7點陣,8位數據接口
        delay(20);
        write_com(0x0c);   //顯示模式設置
        delay(20);
        write_com(0x07);   //顯示模式設置:光標右移,字符不移
        delay(20);
        write_com(0x01);   //清屏幕指令,將以前的顯示內容清除
        delay(20);       
}

void main()
{
        uchar a;
        init();

        write_com(0x80);         
        delay(50);
        for(a=0;a<18;a++)
        {
        write_date(table1[a]);
        delay(40);               
        }

        write_com(0x80+0x40);
        delay(50);
        for(a=0;a<18;a++)
        {
        write_date(table2[a]);
        delay(40);               
        }

        for(a=0;a<16;a++)
        {
                write_com(0x18); //左移
                delay1(1000);
        }
        while(1);
}
回復

使用道具 舉報

ID:301821 發表于 2018-4-5 10:56 | 顯示全部樓層
qq347336987 發表于 2018-4-4 11:32
#include
#define uchar unsigned char
#define uint unsigned int

謝謝
回復

使用道具 舉報

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

本版積分規則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

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