初始化:
cvoid OLED_Init(void)
{
oled_port_init();
delay(4000); //初始化之前的延时很重要!
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_Clear();
OLED_WR_Byte_(0xAF, OLED_CMD); //--turn on oled panel
}
这些字符:
bash !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
取字模方法:
效果:
本文作者:Dong
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 CC BY-NC。本作品采用《知识共享署名-非商业性使用 4.0 国际许可协议》进行许可。您可以在非商业用途下自由转载和修改,但必须注明出处并提供原作者链接。 许可协议。转载请注明出处!