Skip to main content
Visitor II
April 25, 2024
Question

no indication on the display

  • April 25, 2024
  • 2 replies
  • 998 views

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);
}
...

 

    This topic has been closed for replies.

    2 replies

    Technical Moderator
    April 25, 2024

    Did you update the screen after calling ssd1306_WriteString?

    ssd1306_UpdateScreen();

     

    Visitor II
    April 25, 2024

    Yes, I have. There is nothing on the screen

    Technical Moderator
    April 25, 2024

    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...