6 years, 3 months ago.

OLED Error

Hi everyone, I'm new to stm32 programming but I have an error in my code that I don't know how to resolve. The error I keep getting is the first line under int main, display.begin();. The error is Expression must have class type"display.begin();". If anyone can help me that would be greatly appreciated, thank you.

The code is as follows:

  1. include <Adafruit_SSD1306.h>
  2. include <mbed.h>
  1. define SSD1306_SWITCHCAPVCC 0x2

Adafruit_SSD1306_I2c display(I2C &i2c,PinName PB_8);

int main() { display.begin(); display.splash(); display.display();

display.clearDisplay(); display.setTextColor(WHITE); display.setCursor(35,30); display.printf("Hello World!");

display.display();

}

Be the first to answer this question.