2

Recently i bought an "Serial 128X64 OLED LCD Display SSD1306".

I searched for available libraries and tried to find the best one to use before actually experimenting with this device.

I came across a hackaday article mentioning a "HIGH SPEED SSD1306 LIBRARY"

So that drew my attention and got on with it. This is the link to the afforementioned library for the Arduino DUE.

DayOLED_SSD1306

Right from the beginning i had some trouble with the wiring. I wired 3.3 volts to input, GND, RES, DC, CS pins are wired according to the library example.. But the library contains no info on how to wire D0 and D1 pins. Since this OLED works both I2C and SPI, i thought maybe these two pins are ommited.

So i hooked it up, load up the example code and got compilation errors.

Here are the errors:

C:\Users\User1\Documents\Arduino\libraries\DayOLED_SSD1306-master\DayOLED_SSD1306.cpp: In member function 'virtual void DayOLED_SSD1306::drawPixel(int16_t, int16_t, uint16_t)':
C:\Users\User1\Documents\Arduino\libraries\DayOLED_SSD1306-master\DayOLED_SSD1306.cpp:114:14: error: 'swap' was not declared in this scope
 swap(x, y);
 ^
C:\Users\User1\Documents\Arduino\libraries\DayOLED_SSD1306-master\DayOLED_SSD1306.cpp: In member function 'virtual void DayOLED_SSD1306::drawFastHLine(int16_t, int16_t, int16_t, uint16_t)':
C:\Users\User1\Documents\Arduino\libraries\DayOLED_SSD1306-master\DayOLED_SSD1306.cpp:598:16: error: 'swap' was not declared in this scope
 swap(x, y);
 ^
C:\Users\User1\Documents\Arduino\libraries\DayOLED_SSD1306-master\DayOLED_SSD1306.cpp: In member function 'virtual void DayOLED_SSD1306::drawFastVLine(int16_t, int16_t, int16_t, uint16_t)':
C:\Users\User1\Documents\Arduino\libraries\DayOLED_SSD1306-master\DayOLED_SSD1306.cpp:666:16: error: 'swap' was not declared in this scope
 swap(x, y);

Anybody got a clue what is going on with the swap() function? Maybe it's deprecated?

Anyone has managed to get this library working? Or maybe has managed to get this Display working even with another library?

asked Mar 4, 2017 at 17:52

2 Answers 2

1

I've had good success with the u8g2 library for the small I2C OLEDs. u8g2 on GitHub

answered Mar 4, 2017 at 18:10
1

I have managed to get this somewhat working with these 4 libraries: #include <SPI.h>, #include <Wire.h>, #include <Adafruit_GFX.h>, #include <Adafruit_SSD1306.h>. These should all be in the include library in the ide. Hope this helps!

answered Jul 1, 2023 at 23:25

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.