Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New SSD1306 128x64 I2C modules producing garbled text but work fine with Adafruit library #123

Open
peteDDD opened this issue Dec 16, 2024 · 2 comments

Comments

@peteDDD
Copy link

peteDDD commented Dec 16, 2024

I have been using this great library for at least 5 years now. I really appreciate the small size and the great feature set which is much better for managing constantly changing ascii screens. Thanks!

Now for the last few batches of SSD1306 .96-inch 128x64 modules, they are all displaying garbled text. In fact, I threw out a bunch of them thinking they were bad from the factory... I decided though to test them using the example Adafruit library code and they worked just fine. No garbled text. The thing is, I prefer your library as I have built many of your functions into my code that the Adafruit library just does not have. I have tried multiple fonts and two I2C speeds but get similar results.

I am using your example code for the test.
Also please see attached photos of the display output from this code.

Again, this is the second batch of displays from different manufacturers that have shown these problems.
This one is labeled: "TS00356a-0.96-Lanban-Bai Display Module 12864 LCD Screen Board for Arduino Color: SSD1306 White"

Any clues for me?

THANKS!

#include <Arduino.h>
#include "SSD1306Ascii.h"
#include "SSD1306AsciiWire.h"

// 0X3C+SA0 - 0x3C or 0x3D
#define OLED_I2C_ADDRESS 0x3C

// Initialize display
SSD1306AsciiWire oled;

// forward declaration
void clearField(uint8_t col, uint8_t row, uint8_t width);

void setup()
{
  Wire.begin();
  // two clock speeds tried
  Wire.setClock(400000L); // Fast I2C mode
  // Wire.setClock(100000L); // Slow I2C mode

  Serial.begin(9600);

  // Initialize OLED - try these options one at a time:
  oled.begin(&Adafruit128x64, OLED_I2C_ADDRESS); // Current - produces garbled characters   
  // oled.begin(&SH1106_128x64, OLED_I2C_ADDRESS);        // Try this option for SH1106 displays
  // Alternative options if needed:
  // oled.begin(&Adafruit128x32, OLED_I2C_ADDRESS);    // For 128x32 displays
  // oled.begin(&Adafruit64x32, OLED_I2C_ADDRESS);     // For 64x32 displays

  // Set font  Three fonts tried
  // oled.setFont(Callibri15);
  // oled.setFont(System5x7);
  oled.setFont(Adafruit5x7);

  // Clear the display
  oled.clear();

  // First row - double size text
  oled.set2X(); // Double size text
  oled.println("Hello!");

  delay(2000);

  // Second row - normal size text
  oled.set1X(); // Normal size text
  oled.println("OLED Display");

  // Third row
  oled.println("Testing 123");
}

void loop()
{
  // Your loop code here8X64
}

Platformio.ini:

[env:megaatmega2560]
platform = atmelavr
board = megaatmega2560
framework = arduino
;upload_port = COM4
board_build.variants_dir = variants
board_build.variant = mcupro
lib_ldf_mode = chain
lib_extra_dirs = ~/Documents/Arduino/libraries

lib_deps = 
    greiman/SSD1306Ascii @ ^1.3.5
@greiman
Copy link
Owner

greiman commented Dec 16, 2024

Any clues for me?

I suspect the controller is not strictly SSD1306 compatible.

Unfortunately I no longer have time to maintain this library.

@peteDDD
Copy link
Author

peteDDD commented Dec 16, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants