Skip to content

Updated support for 64x48 displays - #136

Closed
dok-net wants to merge 0 commit into
adafruit:masterfrom
dok-net:master
Closed

Updated support for 64x48 displays#136
dok-net wants to merge 0 commit into
adafruit:masterfrom
dok-net:master

Conversation

@dok-net

@dok-net dok-net commented Mar 23, 2019

Copy link
Copy Markdown

Merges the support originally added in https://github.com/mcauser/Adafruit_SSD1306.git with the head of adafruit/Adafruit_SSD1306.
The splash screen was adopted to mirror that of the other resolution displays.
Relevant displays are for instance those for the Wemos/LOLIN D1 OLED shield.

@Misiu

Misiu commented Mar 27, 2019

Copy link
Copy Markdown

@PaintYourDragon, @ladyada could You please take a look at this PR. I need this too.

@ladyada

ladyada commented Mar 27, 2019

Copy link
Copy Markdown
Member

hiya we have no way of testing this so it may be a while until we get hardware and are able to check hat this works and doesn't break other displays

@Misiu

Misiu commented Mar 28, 2019

Copy link
Copy Markdown

@ladyada currently I'm using folk (library) by @mcauser and everything works fine.
I have 64x48, 128x64 and 128x32 displays so I can check them out, but I'm not an expert if it comes to C++ so additional tests by more users are more than welcome 😉

@tablatronix

tablatronix commented Apr 29, 2019

Copy link
Copy Markdown

I have a 64x32 oled, I just changed this pr to 32 and it works, FYI, so that is one more definition that can be added

@Misiu

Misiu commented May 6, 2019

Copy link
Copy Markdown

@tablatronix any chance You might add this as a PR?
@ladyada any chance You could take a look at this again? 😉

@tablatronix

tablatronix commented May 6, 2019

Copy link
Copy Markdown

Adafruit typically will not merge a pr that they have not personally tested or for products they do not sell, which is fine and understandable from a support perspective.

Everything needs a code review, one little thing could break it for someone

@dok-net

dok-net commented May 7, 2019

Copy link
Copy Markdown
Author

@tablatronix Regarding your 64x32 OLED, did you just set the resolution in your sketch, as is the current way of using the lib, or were there any change to lib code itself?
I am particularly interested in the splash screen (star fruit logo).

@dok-net

dok-net commented May 7, 2019

Copy link
Copy Markdown
Author

@ladyada Could you please give me a hint as to what the expected behavior in the scroll tests is for your supported boards? The test scrolls some text to the right and downward, I have apparently uninitialized black and white pixels scrolling in from the left and top edges...

@Misiu

Misiu commented May 7, 2019

Copy link
Copy Markdown

@tablatronix Adafruit doesn't sell 64x48 or 64x32 displays, but that doesn't mean they can't support them in this lib.
The displays can be bought for about $2 on Aliexpress. If the physical display is needed for reviewing and merging this PR I'm more than happy to order them for Adafruit. @ladyada would that be ok with You? WIll that help?

@tablatronix

Copy link
Copy Markdown

@dok-net if you have fringing on an edge then the offsets for your screen is wrong in the code

@tablatronix

Copy link
Copy Markdown

@Misiu the problem is not testing, the problem is support for paying customers, the risk of breaking a library for paid products and causing uneeded support issues for in house testing by adding support for something not in their product line is not worth it. Also there are unlimited variations of these displays, with different memory mapping etc. you have chinese sources of red tab, blue tab, green tab displays and they might all have different init codes, most lack a reset line and can get stuck.

@ladyada

ladyada commented May 11, 2019

Copy link
Copy Markdown
Member

hihi we will get to this but yes its a lower priority and hard to test :/

@Misiu

Misiu commented May 13, 2019

Copy link
Copy Markdown

@tablatronix most of those displays use SSD1306.
I'm using this display with the modified library by @mcauser without any trouble.
I agree with You that it will be hard to support all variations of those displays, especially adding one feature can break other previously working (especially for products sold by Adafruit), but supporting one or two sizes would help.
I don't see any contraindications why Adafruit could not sell OLED displays in such size 😁

The best part is that support for 64x48 display is already written and tested. All needed it adding it here.

@dok-net

dok-net commented May 13, 2019

Copy link
Copy Markdown
Author

@Misiu Could you please switch to my fork instead of @mcauser 's, if you haven't already done so. I would be specifically interested in feedback on the scrolling behavior I've mentioned. I am asking you because I have merged Adafruit's latest changes, created a proper new splash image, while mcauser would appear to have moved on for 3 years now.
You might also enjoy https://github.com/dok-net/D1_mini_Examples.git, my fork of Wemos' repository.

@Misiu

Misiu commented May 13, 2019

Copy link
Copy Markdown

@dok-net sure, I get back home and do a simple test using Wemos D1 and their display.
I'll try to record a video showing how the example code behaves.

@dok-net

dok-net commented May 13, 2019

Copy link
Copy Markdown
Author

The white noise that's scrolled in from the left is the same in mcauser's old version as it is in my merge of the current Adafruit lib.
One improvement over mcauser's revision is that ESP32 was added as a target. the Wemos/LOLIN shield is plug-and-play compatible with WEMOS D1 mini ESP32 boards.

@mcauser

mcauser commented May 13, 2019

Copy link
Copy Markdown

With regards to hardware scrolling, you have to remember the SSD1306 has no idea you are using it to power a smaller 64x48 OLED. It simply scrolls the entire 128x64 buffer. The white noise / artefacts you see is just an uninitialised block of the display memory. When you initalise this library to work with a 64x48 OLED, you're effectively just restricting which parts of the display memory is written to. Same as when you draw a line, you give it an x, y, w and h and feed in the bytes just for that rectangle.

I haven't used this library in a while, but am happy to assist with testing with my growing collection of displays and dev boards.

@mcauser

mcauser commented May 13, 2019

Copy link
Copy Markdown

adafruit
^ FYI this is @dok-net 's proper Adafruit splash screen image for 64x48 screen size

@dok-net

dok-net commented May 13, 2019

Copy link
Copy Markdown
Author

@mcauser @ladyada I've fixed this now by using the full 128 "segments" with any display width, the 64x48 only gets special treatment for the OLED being bound at 32 columns horizontal offset.
In the future this allows the use of the full internal RAM for banner display, hardware scrolling left and right. I am not sure what Adafruit_GFX thinks of negative offsets etc. :-)

@mcauser

mcauser commented May 14, 2019

Copy link
Copy Markdown

Somewhat unrelated... An interesting side effect of having a display with a driver with memory larger than the visible pixels is that you could use the off screen pixels as temporary volatile storage. Or if you had one of those 128x32 displays, thats exactly half of the 128x64 memory, so you could write to both memory areas and quickly flip between the two for animations.

@tablatronix

Copy link
Copy Markdown

I have seen a forked lib that does this an adds scrolling/paging

@MstrVLT

MstrVLT commented Sep 21, 2019

Copy link
Copy Markdown

Working! thx @dok-net

@dok-net

dok-net commented Oct 26, 2019

Copy link
Copy Markdown
Author

A heads up: I've rebased to version 2.0.1. It's my POV that this PR is complete and mergeable, additional features, like auto-scrolling, are optional features and beyond the scope of this.

@dok-net

dok-net commented Oct 7, 2020

Copy link
Copy Markdown
Author

Moved to #188 after switching source branch.

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

Successfully merging this pull request may close these issues.

6 participants