[SOLVED] WaveShare 2.42in OLED not working with Uno R4 Wifi

Hello,
I recently purchased a Waveshare 2.42 inch OLED Module (linked below), and I cannot get it to work, I have tried running it on SPI and L2C (both of which are supported), shifting the cables into every port possible, using U8G2, U8glib, Adafruit, and even Spark Fun libraries, but still it refuses to work. Can someone tell me if this is just bad code or if its a hardware problem, or if it is just defective,
Thank you.

Note: It uses the SSD1309 Driver, and only has one color option.

Welcome to the forum

Please post a sketch that you have tried that does not work, and the corresponding schematic showing how the screen was connected to the Arduino. A 'photo of a hand drawn circuit is good enough as long as all connections are labelled clearly

Thank you,
The closest sketch I have gotten to work has been the one attached. The wiring circuit I am using currently (and used for the attached sketch) is the photo attached, I used the same connections as recommended by the manufacturer. The only differences are:

The OLED display does not have the MOSI nor SACKI, so instead I am using:
OLED Port Arduino Port
CLK -> D10
DIN -> D11

#include "U8g2lib.h"

#define OLED_CLK D13
#define OLED_DIN D11
#define OLED_CS D10
#define OLED_DC D7
#define OLED_RESET D8

//Working Constructor
U8G2_SSD1309_128X64_NONAME0_1_4W_SW_SPI u8g2(U8G2_R0, OLED_CLK, OLED_DIN, OLED_CS, OLED_DC, OLED_RESET);

void setup() {
  Serial.begin(115200);
  u8g2.begin();

  u8g2.setFont(u8g2_font_ncenB08_tr);
  u8g2.clearBuffer();
  u8g2.setCursor(0, 20);
  u8g2.print("Hello");
  u8g2.sendBuffer();
  Serial.print("Buffer Sent");

  delay(2000);
}


void loop() {

}

I finally got it to work with the following code:

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

#define CS_PIN D10
#define DC_PIN D7
#define RESET_PIN D8

U8G2_SSD1309_128X64_NONAME0_F_4W_SW_SPI u8g2(U8G2_R0, D13, D11, CS_PIN, DC_PIN, RESET_PIN);

void setup(void) {
  Serial.begin(115200);
  Serial.println("Serial.begin");
  u8g2.begin();
  u8g2.clearBuffer();
  u8g2.setFont(u8g2_font_ncenB14_tr);
  u8g2.drawStr(20,35,"Hello");
  u8g2.sendBuffer();
  Serial.println("Success");
  delay(3000);
  u8g2.clearBuffer();
  u8g2.clearDisplay();
}

void loop(void) {

}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.