Large OLED I2C display SSD1309

I purchaesd one of the above OLED displays from you.

I am useing it on ESP32 board

I can get some things to display with the SSD1306 library

What library would you sugest for the SSD1309 with some example code would be great.

I realy want to have a scrolling display

I look forward to your reply

Hi there, @Ian222769, and welcome to the forum. Glad to have you here.

We actually recommend using this SSD1306 code for the SSD1309 as there is enough overlap that there should be too much of an issue.

However, if you are after specific SSD1309 code and you are using Micropython, this github repository includes plenty of code and examples.

Hi Jane
thank you for your reply
the followup from CORE is always great.
I am using Arduino IDE for programming the ESP32
I can use the 1306 for most functions but can not get the Scrolling to work
Regards
Ian Rusch

1 Like

Thanks for that, Ian,

Could you upload the code that you’re currently using for scrolling.

Once I have that I should be able to give some better advice.

Hi Jane
attached code I was running SSD1306 on ESP32 with a small 0.96" OLED.
this scrolls ok but not on your larger OLED

Hope this helps
Ian Rush

(Attachment SSD1306 code.docx is missing)

1 Like

Hi Jane
tried sending the code in an DOCX document but your system rejected it
what format would you like me to send the code to you.

Ian

1 Like

Hi Ian,

That’s fine, the usual method is to put your code at the bottom of your reply within a pair of triple backquotes (``` ```). Everything between them will be formatted as code for readability.

Hi Jane
see if this works
Ian

//Testing bounce switch with ULN2003 stpper driver

// Scrolling OLED working 26/10/2025

// Include the Arduino Stepper.h library:

#include <AccelStepper.h> //Include the AccelStepper library

#include <Bounce2.h>

#include <SPI.h>

#include <Adafruit_GFX.h>

#include <Adafruit_SSD1306.h>

Adafruit_SSD1306 display(128, 64, &Wire, -1);

const int inputPin = 27; // the number of the push button pin

const int ledPin = 2; // the number of the LED pin

int ledValue = LOW;

// boolean isLighting = false; // define a variable to save the state of LED

// Define the motor pins:

#define MP1 25 // IN1 on the ULN2003

#define MP2 33 // IN2 on the ULN2003

#define MP3 32 // IN3 on the ULN2003

#define MP4 35 // IN4 on the ULN2003

#define MotorInterfaceType 8 // Define the interface type as 8 = 4 wires * step factor (2 for half step)

AccelStepper stepper = AccelStepper(MotorInterfaceType, MP1, MP3, MP2, MP4); //Define the pin sequence (IN1-IN3-IN2-IN4)

const int SPR = 2048;

Bounce bouncer = Bounce(); //Steps per revolution

void setup() {

Serial.begin(115200);

pinMode(inputPin, INPUT); // set push button pin into input mode

pinMode(ledPin, OUTPUT); // set LED pin into output mode

bouncer.attach(inputPin); // bouncer.interval(50); // interval in ms

stepper.setMaxSpeed(1000); //Set the maximum motor speed in steps per second

stepper.setAcceleration(200); //Set the maximum acceleration in steps per second^2

Wire.begin(22, 21); // SDA, SCL 

display.begin(SSD1306_SWITCHCAPVCC, 0x3c); // may need to change this

display.setTextSize(1);

display.setTextColor(WHITE);

// Scroll full screen

display.clearDisplay();

display.setCursor(0, 1);

display.setTextSize(1);

display.println("PUSH to START");

display.println("PUSH AGAIN to STOP");

// display.println("scrolling!");

display.display();

display.startscrollright(0x00, 0x07);

}

void loop() {

if (bouncer.update() && bouncer.read() == LOW) {

ledValue = ! ledValue;

digitalWrite(ledPin, ledValue);

Serial.print(" ledValue ");

Serial.println(ledValue);

}

if (ledValue == HIGH){

// stepper.moveTo(5 * SPR); //Set the target motor position 5 looks better than 3 (i.e. turn motor for 3 full revolutions)

// stepper.runToPosition(); // Run the motor to the target position

// delay(1000);

// stepper.moveTo(-5 * SPR); //Same as above: Set the target motor position (i.e. turn motor for 3 full revolutions)

// stepper.runToPosition(); // Run the motor to the target position

// delay(1000); 

Motor();

}

if (ledValue == LOW){

}

}

void Motor(){

stepper.moveTo(5 * SPR); //Set the target motor position 5 looks better than 3 (i.e. turn motor for 3 full revolutions)

stepper.runToPosition(); // Run the motor to the target position

delay(1000);

stepper.moveTo(-5 * SPR); //Same as above: Set the target motor position (i.e. turn motor for 3 full revolutions)

stepper.runToPosition(); // Run the motor to the target position

delay(1000);

}
1 Like

Hey Ian,

Sorry about the delayed response, it’s been a busy two days.

May I ask why you are using x0.07 for your scrolling end point? Are you not trying to scroll the entire display?

display.startscrollright(0x00, 0x07);

If you are trying to scroll the entire display, try using 0x0F as the second parameter.

Hi Jane
I had not noticed that
I am away in SA at the moment will try that when I am back in Melbourne
Thanks again for your help

Ian

1 Like

Hi Jane
back in Melbourne
tried that still no luck.
Thanks for your help will just stay with a static display

Ian

1 Like

I’m sorry to hear that, Ian.

I hope you at least had a good South Australia trip. :slight_smile: