Please help me make this sketch a 128x32 i2c OLED Display Compatible sketch?

I have recently bought an OLED Screen
Here are displays specs:
Resolution: 128X64
Pin type: I2C
Model: SSD1306

And looks like this:

I wanted to try a game on it, and the link to the project is here:

This is a nice game and i Want to try it, but the screen in this project has 7pins and not 4pins.
Can somebody help me convert this 7pin compatible sketch to a 4pin compatible sketch?
The code is attached

Pong_Game.ino (3.81 KB)

You are already using the hardware SPI constructor()

Adafruit_SSD1306 display(OLED_DC, OLED_RESET, OLED_CS);

Replace with the I2C constructor

Adafruit_SSD1306 tft(128, 64, &Wire);

Job done!

Obviously you must use the SDA, SCL pins on your (undisclosed) Arduino.

The attached code may be for hardware SPI but the defined DC, RST, CS pins are no good for a Uno.


Thank You!!! :smiley:

Oops. Your title says 128x32. The sketch is written for 128x64.

I doubt if it will look any good on a 128x32 display.