打印
[资料工具]

OLED屏的初始化函数

[复制链接]
479|2
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
一点点0321|  楼主 | 2020-8-21 13:02 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
void OLED_Init(void)

{
    //SSD1306                                
    OLED_SCLK_Set();

    OLED_SDIN_Set();        
    Delay_1ms(800);
    OLED_WR_Byte(0xAE,OLED_CMD);//--display off

        OLED_WR_Byte(0x00,OLED_CMD);//---set low column address

        OLED_WR_Byte(0x10,OLED_CMD);//---set high column address

        OLED_WR_Byte(0x40,OLED_CMD);//--set start line address  

        OLED_WR_Byte(0xB0,OLED_CMD);//--set page address

        OLED_WR_Byte(0x81,OLED_CMD); // contract control

        OLED_WR_Byte(0xFF,OLED_CMD);//--128   

        OLED_WR_Byte(0xA1,OLED_CMD);//set segment remap
        OLED_WR_Byte(0xA6,OLED_CMD);//--normal / reverse

        OLED_WR_Byte(0xA8,OLED_CMD);//--set multiplex ratio(1 to 64)

        OLED_WR_Byte(0x3F,OLED_CMD);//--1/32 duty

        OLED_WR_Byte(0xC8,OLED_CMD);//Com scan direction

        OLED_WR_Byte(0xD3,OLED_CMD);//-set display offset

        OLED_WR_Byte(0x00,OLED_CMD);//

        OLED_WR_Byte(0xD5,OLED_CMD);//set osc division

        OLED_WR_Byte(0x80,OLED_CMD);//

        OLED_WR_Byte(0xD8,OLED_CMD);//set area color mode off

        OLED_WR_Byte(0x05,OLED_CMD);//

        OLED_WR_Byte(0xD9,OLED_CMD);//Set Pre-Charge Period

        OLED_WR_Byte(0xF1,OLED_CMD);//

        OLED_WR_Byte(0xDA,OLED_CMD);//set com pin configuartion

        OLED_WR_Byte(0x12,OLED_CMD);//

        OLED_WR_Byte(0xDB,OLED_CMD);//set Vcomh

        OLED_WR_Byte(0x30,OLED_CMD);//

        OLED_WR_Byte(0x8D,OLED_CMD);//set charge pump enable

        OLED_WR_Byte(0x14,OLED_CMD);//

        OLED_WR_Byte(0xAF,OLED_CMD);//--turn on oled panel

}


使用特权

评论回复

相关帖子

沙发
weifeng90| | 2020-9-18 19:08 | 只看该作者
点亮没有啊?

使用特权

评论回复
板凳
guijial511| | 2020-9-18 19:17 | 只看该作者
只是程序,没有板子?

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

33

主题

345

帖子

0

粉丝