void OLED_Init()
{
unsigned char i;
RES=0;
for(i=0;i<200;i++)
{
uDelay(200);
}
RES=1;
Set_Display_On_Off(0xAE); // Display Off (0xAE/0xAF)
Set_Display_Clock(0xA0); // Set Clock as 80 Frames/Sec
Set_Multiplex_Ratio(0x3F); // 1/64 Duty (0x0F~0x3F)
Set_Display_Offset(0x00); // Shift Mapping RAM Counter (0x00~0x3F)
Set_Start_Line(0x00); // Set Mapping RAM Display Start Line (0x00~0x3F)
Set_Master_Config(0x8E); // Disable Embedded DC/DC Converter (0x8E/0x8F)
Set_Area_Color(0x05); // Set Monochrome & Low Power Save Mode
Set_Addressing_Mode(0x02); // Set Page Addressing Mode (0x00/0x01/0x02)
Set_Segment_Remap(0xA1); // Set SEG/Column Mapping (0xA0/0xA1)
Set_Common_Remap(0xC8); // Set COM/Row Scan Direction (0xC0/0xC8)
Set_Common_Config(0x12); // Set Alternative Configuration (0x02/0x12)
Set_LUT(0x3F,0x3F,0x3F,0x3F); // Define All Banks Pulse Width as 64 Clocks
Set_Contrast_Control(Brightness); // Set SEG Output Current
Set_Area_Brightness(Brightness); // Set Brightness for Area Color Banks
Set_Precharge_Period(0x82); // Set Pre-Charge as 8 Clocks & Discharge as 2 Clocks
Set_VCOMH(0x3C); // Set VCOM Deselect Level
Set_Entire_Display(0xA4); // Disable Entire Display On (0xA4/0xA5)
Set_Inverse_Display(0xA6); // Disable Inverse Display On (0xA6/0xA7)
Fill_RAM(0x00); // Clear Screen
Set_Display_On_Off(0xAF); // Display On (0xAE/0xAF)
}
有奖活动 | |
---|---|
“我踩过的那些坑”主题活动——第002期 | |
【EEPW电子工程师创研计划】技术变现通道已开启~ | |
发原创文章 【每月瓜分千元赏金 凭实力攒钱买好礼~】 | |
【EEPW在线】E起听工程师的声音! | |
高校联络员开始招募啦!有惊喜!! | |
【工程师专属福利】每天30秒,积分轻松拿!EEPW宠粉打卡计划启动! | |
送您一块开发板,2025年“我要开发板活动”又开始了! | |
打赏了!打赏了!打赏了! |