標(biāo)題: 求助大佬講解一下oled12864用iic接線設(shè)置坐標(biāo)和寫數(shù)據(jù)等代碼 [打印本頁]

作者: 80265484    時(shí)間: 2020-3-19 13:55
標(biāo)題: 求助大佬講解一下oled12864用iic接線設(shè)置坐標(biāo)和寫數(shù)據(jù)等代碼
秋大佬詳細(xì)解釋一下下面的代碼,oled寫數(shù)據(jù)

void OLED_WrDat(unsigned char IIC_Data)
{
        IIC_Start();
        Write_IIC_Byte(0x78);
        Write_IIC_Byte(0x40);                        //write data
        Write_IIC_Byte(IIC_Data);
        IIC_Stop();
}
oled寫命令
void OLED_WrCmd(unsigned char IIC_Command)
{
        IIC_Start();
        Write_IIC_Byte(0x78);        
        Write_IIC_Byte(0x00);               
        Write_IIC_Byte(IIC_Command);
        IIC_Stop();
}
oled寫坐標(biāo)
void OLED_Set_Pos(unsigned char x, unsigned char y)
{
        OLED_WrCmd(0xb0+y);
        OLED_WrCmd(((x&0xf0)>>4)|0x10);
        OLED_WrCmd((x&0x0f));       
//OLED_WrCmd((x&0x0f)|0x01);
}
oled全屏
void OLED_Fill(unsigned char bmp_dat)
{
        unsigned char y,x;
        for(y=0;y<8;y++)
        {
                OLED_WrCmd(0xb0+y);
                OLED_WrCmd(0x01);
                OLED_WrCmd(0x10);
                for(x=0;x<X_WIDTH;x++)
                OLED_WrDat(bmp_dat);
        }



作者: 25038    時(shí)間: 2022-3-29 16:29
樓主現(xiàn)在知道了嗎,同樣想知道啊





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