cancel
Showing results for 
Search instead for 
Did you mean: 

no indication on the display

stm32beginner2024
Associate II

Hello,

what do I have to change in the code so that I see something on the oled display 0x78?

Maybe someone has a tip for me

Thanks :)

...
#define ssd1306_I2C_Port hi2c2
#define ssd1306_I2C_ADDR 0x78
...
#define ssd1306_WIDTH 128
#define ssd1306_HEIGHT 64
...
I2C_HandleTypeDef hi2c2;
...
int main(){
  char myText[] = "Hello ";
  HAL_Init();
  SystemClock_Config();
  MX_GPIO_Init();
  MX_FSMC_Init();
  MX_I2C2_Init();
  MX_QUADSPI_Init();
  MX_USART2_UART_Init();
  MX_USB_HOST_Init();
 
  ssd1306_Init(); 
  ssd1306_Fill(White);
  ssd1306_UpdateScreen();
 
  ssd1306_SetCursor(3, 3);
  ssd1306_WriteString(myText, Font_7x10, White);
}
...

 

3 REPLIES 3
Peter BENSCH
ST Employee

Did you update the screen after calling ssd1306_WriteString?

ssd1306_UpdateScreen();

 

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Yes, I have. There is nothing on the screen

Peter BENSCH
ST Employee

Well, you have only given us what you consider to be a sufficient part of your programme. For example, have you included the header file with the fonts?

You could also test whether you can fill with black, for example, after filling with white (using a debugger and a breakpoint or some delay in between). You'll probably even be able to see something, as you're currently writing in white on a white background with the programme part mentioned above...

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.