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

標題: LCD12864液晶串行驅(qū)動顯示 [打印本頁]

作者: 3574    時間: 2018-12-26 20:52
標題: LCD12864液晶串行驅(qū)動顯示
12864液晶顯示


#include "lcd12864.h"
#include "reg51.h"

void delay_ms(unsigned char nms)
{
        unsigned int i, j;
        for(i = nms; i > 0; i--)
                for(j = 110; j > 0; j--);
}

void lcd_sendbyte(unsigned char byte)
{
        unsigned char i;
        for(i = 0; i < 8; i++)
        {
                SCLK = 0;
                delay_ms(2);
                SID = (bit)(byte&0x80);
                SCLK = 1;
                byte = byte << 1;
        }
}

void write_cmd(unsigned char cmd)
{
        CS = 1;
        lcd_sendbyte(0xf8);
        lcd_sendbyte(0xf0&cmd);
        lcd_sendbyte(0xf0&(cmd << 4));
        CS = 0;
        delay_ms(10);
}

void write_dat(unsigned char dat)
{
        CS = 1;
        lcd_sendbyte(0xfa);
        lcd_sendbyte(0xf0&dat);
        lcd_sendbyte(0xf0&(dat << 4));
        CS = 0;
        delay_ms(10);       
}
void lcd_pos(unsigned char x, unsigned char y)
{
        unsigned char pos;
        switch(x)
        {
                case 0: x = 0x80; break;
                case 1: x = 0x90; break;
                case 2: x = 0x88; break;
                case 3: x = 0x98; break;
        }       
        pos = x + y;
        write_cmd(pos);
}

void lcd12864_init()
{
        PSB = 0;
        write_cmd(0x30);
        delay_ms(5);
        write_cmd(0x0c);
        delay_ms(5);
        write_cmd(0x01);
        delay_ms(5);
}

void lcd_display(unsigned char line, unsigned char column, char *str)
{
        lcd_pos(line, column);
        while(*str)
        {
                write_dat(*str++);
        }
}


1.串行驅(qū)動顯示.rar

39.63 KB, 下載次數(shù): 12, 下載積分: 黑幣 -5

12864顯示


作者: yangguo48    時間: 2019-2-12 18:35
垃圾,別下載





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