Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
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:
- include <Adafruit_SSD1306.h>
- include <mbed.h>
- 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();
}