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

Flickering 2.0 #32

Closed
Cardboardboxprocessor opened this issue Feb 18, 2018 · 4 comments
Closed

Flickering 2.0 #32

Cardboardboxprocessor opened this issue Feb 18, 2018 · 4 comments

Comments

@Cardboardboxprocessor
Copy link

Screen is flickering as if literally seeing it refresh. worsening on right side and lower side of screen .

COde:

#define I2C_ADDRESS 0x3C
#include <Wire.h>
#include "SSD1306Ascii.h"
#include "SSD1306AsciiWire.h"

SSD1306AsciiWire oled;

void setup()
{
Wire.begin();
oled.begin(&Adafruit128x32, I2C_ADDRESS);
oled.set400kHz();
oled.setFont(Iain5x7);
}

void loop()
{
oled.clear();
oled.println("flickering");
}

Chip:
Arduino Nano V3.0, Elegoo Nano board CH340/ATmega328P

Screen:
MakerFocus 2pcs I2C OLED Display Module 0.91 Inch I2C SSD1306 OLED Display Module Blue I2C OLED Screen Driver DC 3.3V~5V for Arduino

@greiman
Copy link
Owner

greiman commented Feb 18, 2018

The SSD1306 has no clear command so a 128x32 display requires writing 512 bytes to display memory.

This take about 24 ms with 400 kHz I2C so your program shows extreme flickering.

The SSD1306 runs at a fairly slow refresh rate so this contributes to the flicker.

@greiman greiman closed this as completed Feb 18, 2018
@greiman
Copy link
Owner

greiman commented Feb 18, 2018

I tried a SPI 128x32 display. It does a clear in about 4 ms. I use 8 MHz SPI clock.

Flicker is much better. This loop is fairly good with the 10 ms delay.

void loop() {
    oled.clear(); 
    oled.print("flicker");
    delay(10);
  }

@sergevm1
Copy link

sergevm1 commented Dec 4, 2019

I have the same issue. Adafruit library doesn't have flickering at all. At they write to some buffer (I guess) and then show the updated screen by the display() command.
I liked this library for its very small amount of consumed memory. But with this issue I don't see a way to use it in practice.

@greiman
Copy link
Owner

greiman commented Dec 5, 2019

Clearing the entire display causes flickering.

This is why the Adafruit library has less flicker. The Adafruit library doesn't clear areas that have not changed, it rewrites these areas with the same data.

If you selectively rewrite only areas that are modified there will be less flickering.

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

3 participants