1

I am just trying to set up the U8g2 library to use an OLED. I read through the documentation and tried copying and pasting the code block example for the constructor, but switched out their information for my OLED's information. After trying to verify, the IDE returned this error: exit status 1 expected ')' before ',' token

#include <SPI.h>
#include <U8g2lib.h>

//Constructor U8G2_SSD1306_128X64_NONAME_1_SW_I2C(U8G2_R0,A5,A4);```

I saw a similar post about this problem from four years ago, but the only suggestion on there was to capitalize the "A" in the analog pins. I tried this and nothing changed. Any help would be much appreciated!

Kayla
  • 21
  • 3

1 Answers1

1

I figured out what I was doing wrong. I was copying the name from the Constructor Reference and immediately inputting the arguments in parentheses. I needed to put u8g2 after the constructor name and then put the arguments. Thanks!

The corrected code is as follows:

#include <Arduino.h>
#include <SPI.h>
#include <U8g2lib.h>

//Constructor U8G2_SSD1306_128X64_NONAME_1_SW_I2C u8g2(U8G2_R0,A5,A4);

Kayla
  • 21
  • 3