Writing a custom library to mirror/flip text on an SSD1306 OLED display

Nagup14
Posts: 8
Joined: Sun Sep 30, 2018 9:54 am

Writing a custom library to mirror/flip text on an SSD1306 OLED display

Postby Nagup14 » Tue Jan 01, 2019 8:02 pm

I have been searching for a library that will mirror text on an OLED display so that when I try to read the text on the screen from a mirror, it will appear the right way around, i.e. I can read the text on the screen when I look at it through a mirror but will appear flipped on the screen itself.

I haven't been able to find a library to do this or I probably haven't explored existing libraries enough but im thinking of creating my own library to allow me to do this. I am using an ESP32 chip and an SSD1306 64x32 px display running over i2c. Im looking for some help since I'm a beginner and I've never made a library for any chips from Espressif.

any help will be much appreciated
Last edited by Nagup14 on Wed Jan 02, 2019 9:19 pm, edited 1 time in total.


ESP_Sprite
Posts: 9766
Joined: Thu Nov 26, 2015 4:08 am

Re: Writing a custom library to mirror/flip text on an SSD1301 OLED display

Postby ESP_Sprite » Wed Jan 02, 2019 9:22 am

Also know that it's usually trivial to modify an existing library to either write the pixels mirrored, or change a register setting in the oled controller so the display does the mirroring all by itself. No need to search for a dedicated library for that.

Nagup14
Posts: 8
Joined: Sun Sep 30, 2018 9:54 am

Re: Writing a custom library to mirror/flip text on an SSD1301 OLED display

Postby Nagup14 » Wed Jan 02, 2019 11:51 am

costaud wrote:
Wed Jan 02, 2019 6:22 am
How about this one ?
https://github.com/espressif/esp-iot-so ... rs/ssd1306
Do I install this from the preferences menu in the Arduino IDE?

Nagup14
Posts: 8
Joined: Sun Sep 30, 2018 9:54 am

Re: Writing a custom library to mirror/flip text on an SSD1301 OLED display

Postby Nagup14 » Wed Jan 02, 2019 11:55 am

ESP_Sprite wrote:
Wed Jan 02, 2019 9:22 am
Also know that it's usually trivial to modify an existing library to either write the pixels mirrored, or change a register setting in the oled controller so the display does the mirroring all by itself. No need to search for a dedicated library for that.
That would be really useful, im worried using another library in my code will cause compatibility issues. How do you suggest I go about changing a setting in the register, is there a guide online? I havent been able to find one on youtube and the datasheets for the display dont explicitly mention the ability to mirror text.

ESP_Sprite
Posts: 9766
Joined: Thu Nov 26, 2015 4:08 am

Re: Writing a custom library to mirror/flip text on an SSD1301 OLED display

Postby ESP_Sprite » Wed Jan 02, 2019 8:21 pm

I just checked the SSD1301 datasheet; it's actually one of the few controllers that does not have a register setting for this, sorry.

Nagup14
Posts: 8
Joined: Sun Sep 30, 2018 9:54 am

Re: Writing a custom library to mirror/flip text on an SSD1301 OLED display

Postby Nagup14 » Wed Jan 02, 2019 9:20 pm

ESP_Sprite wrote:
Wed Jan 02, 2019 8:21 pm
I just checked the SSD1301 datasheet; it's actually one of the few controllers that does not have a register setting for this, sorry.
my bad, I actually meant 1306 i believe its called "segment re-map" but I dont know how to actually change the register setting


Nagup14
Posts: 8
Joined: Sun Sep 30, 2018 9:54 am

Re: Writing a custom library to mirror/flip text on an SSD1306 OLED display

Postby Nagup14 » Sat Jan 05, 2019 12:17 pm

Ive found a solution, turns out it was in the library I was using already, just had to find all the commands and mix "flipDisplayVertically" and "mirrorScreen" works like a charm.

The library is "SSD1306.h"

Who is online

Users browsing this forum: No registered users and 117 guests