OLED data display based on SPI/IIC interface

Show student ID and name

Part of the code The
code uses
the LCD_Test function in the main.c function of the wildfire sample program to change the display content

void LCD_Test(void)
{
    
    
	/*显示变量*/
	static uint8_t testCNT = 0;	
	char dispBuff[100];
	
	testCNT++;	
	
	LCD_SetFont(&Font8x16);
	LCD_SetColors(RED,BLACK);

  ILI9341_Clear(0,0,LCD_X_LENGTH,LCD_Y_LENGTH);	/* 清屏,显示全黑*/
	/********显示字符串*******/ 
  ILI9341_DispStringLine_EN_CH(LINE(0),"631607040319");	
   ILI9341_DispStringLine_EN_CH(LINE(1),"喻");

The character code
Insert picture description here
in the sample program can be generated in the font software to display the code of the word you want to display.
Insert picture description here
Add the generated character code to the fonts.c file and
finally compile and burn it.

Display the temperature and humidity of AHT20

Part of the code,
Insert picture description here
Insert picture description here
Insert picture description here
finally compile the burning program

Swipe up and down or left and right to display long characters

On the basis of the first liquid crystal display program, a new roll function is added for scrolling display, which is realized by hardware

void roll(void)
{
    
      
	OLED_WR_Byte(0x2F, OLED_CMD);  
	OLED_WR_Byte(0x27, OLED_CMD);   
	OLED_WR_Byte(0x00,OLED_CMD);       
  	OLED_WR_Byte(0x00,OLED_CMD);        
  	OLED_WR_Byte(0x07,OLED_CMD);        
  	OLED_WR_Byte(0x2E,OLED_CMD); 	
  	while(1);
}

Display function

void show_roll(void)
{
    
    	
	GUI_ShowCHinese(45,16,16,"123456",1);
}

Finally, compile and run.
Because the hardware debugging is unsuccessful, no actual effect is made, but the display process is basically clear.
Reference: https://blog.csdn.net/qq_45999753/article/details/111571924

Guess you like

Origin blog.csdn.net/xianyudewo/article/details/111773506