Skip to content

Updated support for 64x48 displays #136

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

Closed
wants to merge 0 commits into from
Closed

Conversation

dok-net
Copy link

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

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
Copy link

Misiu commented Mar 27, 2019

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

@ladyada
Copy link
Member

ladyada commented Mar 27, 2019

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
Copy link

Misiu commented Mar 28, 2019

@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
Copy link

tablatronix commented Apr 29, 2019

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
Copy link

Misiu commented May 6, 2019

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

@tablatronix
Copy link

tablatronix commented May 6, 2019

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
Copy link
Author

dok-net commented May 7, 2019

@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
Copy link
Author

dok-net commented May 7, 2019

@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
Copy link

Misiu commented May 7, 2019

@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

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

@tablatronix
Copy link

@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
Copy link
Member

ladyada commented May 11, 2019

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

@Misiu
Copy link

Misiu commented May 13, 2019

@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
Copy link
Author

dok-net commented May 13, 2019

@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
Copy link

Misiu commented May 13, 2019

@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
Copy link
Author

dok-net commented May 13, 2019

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
Copy link

mcauser commented May 13, 2019

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
Copy link

mcauser commented May 13, 2019

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

@dok-net
Copy link
Author

dok-net commented May 13, 2019

@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
Copy link

mcauser commented May 14, 2019

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

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

@MstrVLT
Copy link

MstrVLT commented Sep 21, 2019

Working! thx @dok-net

@dok-net
Copy link
Author

dok-net commented Oct 26, 2019

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
Copy link
Author

dok-net commented Oct 7, 2020

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