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)
}
我要赚赏金打赏帖 |
|
|---|---|
| 片外存储Flash使用方法(Arduino IDE环境)被打赏¥22元 | |
| 三分钟快速上手ESP-NOW(ArduinoIDE环境)被打赏¥23元 | |
| 【S32K3XX】LPSPI参数配置说明被打赏¥21元 | |
| 在WT9932C61-TINY上实现超声波测距被打赏¥22元 | |
| 基于WT9932C61-TINY的环境构建及OLED屏驱动测试被打赏¥20元 | |
| 【S32K3XX】Core-to-Core 中断使用被打赏¥21元 | |
| 「AI编程记录--含源码」用一晚上的时间写一个esp32的示波器被打赏¥19元 | |
| STM32C0116DK开发探索记(3)被打赏¥30元 | |
| STM32C0116DK开发探索记(2)被打赏¥24元 | |
| STM32C0116DK开发探索记(1)被打赏¥29元 | |
我要赚赏金
