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

Add a SSD1306 I2C example #49

Closed
wants to merge 3 commits into from
Closed

Conversation

JamesH65
Copy link
Collaborator

@JamesH65 JamesH65 commented Feb 9, 2021

This is a 128x64 monochrome display, 0.96" diagonal so very small.

This example initialises the display, and implements basic pixel, line drawing and
text output.

int fb_idx = y * 128 + x;

for (int i=0;i<8;i++) {
uint16_t w = ExpandByte(reversed[idx * 8 + i]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RP2040 has lots of memory - maybe it's worth creating a BigFontCache rather than calling ExpandByte over and over again? 🤷‍♂️

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Certainly a possibility. I'll have think as it's quite an expensive function, but tbh, the display refresh massively overwhelmed the rendering time. Its only 512 bytes of cache though.....

@kilograham kilograham changed the base branch from master to develop March 4, 2021 15:12
@JamesH65
Copy link
Collaborator Author

JamesH65 commented Mar 5, 2021

I don't have anything further to add to this right now, it doesn't use I2C defaults, so doesn't appear to be anything to do there. If there is stuff that neds to be fixed up, please let me know.

@lurch
Copy link
Contributor

lurch commented Mar 5, 2021

Looks like you need to rebase this to the latest develop?

@kilograham
Copy link
Contributor

is this now obsolete?

@JamesH65
Copy link
Collaborator Author

I thought it was merged weeks ago....not obsolete as far as I know, but not been paying attention to Pico examples, so may be wrong.

@lurch
Copy link
Contributor

lurch commented Apr 19, 2021

I think if you rebase it against the current develop, and then make use of the PICO_DEFAULT_I2C defines (which might mean you'll need to update your wiring diagram), I think this should be good to merge?

@JamesH65
Copy link
Collaborator Author

IIRC, I specifically didn't use the default defines because variety is the spice of life.

@lurch
Copy link
Contributor

lurch commented Apr 19, 2021

Ahhh, fair enough 🙂 IIRC the advantage of using the default defines is that it makes your code more easily portable to other (non-Pico) RP2040 boards. But I'll let @kilograham or @aallan make that call...
(and this PR still needs rebasing in any case)

@aallan
Copy link

aallan commented Jul 1, 2021

…and just to link back. We duplicated, see #130. 🤦‍♂️

@JamesH65
Copy link
Collaborator Author

JamesH65 commented Jul 8, 2021

I thought this had been merged....

@lurch
Copy link
Contributor

lurch commented Jul 8, 2021

It can't (yet) be merged because it still needs to be rebased against the latest develop.
It's probably up to Alasdair and Graham what happens to this in relation to #130 ... 🤷

@aallan
Copy link

aallan commented Oct 25, 2021

@kilograham This looks to be a semi-sorta-duplicate of #130 which did (will be?) merged when the merge-intern branch gets merged in? If you've already merged that PR we probably should close this one?

This is a 128x64 monochrome display, 0.96" diagonal so very small.

This example initialises the display, and implements basic pixel, line drawing and
text output.
@JamesH65
Copy link
Collaborator Author

I've updating to latest develop, but this does cross with the other example. No idea what people want to do with this.

@JamesH65
Copy link
Collaborator Author

Ah, pushed to a new branch instead of my personal repo. https://github.com/raspberrypi/pico-examples/tree/ssd1306

@JamesH65
Copy link
Collaborator Author

Now pushed to correct branch.

i2c/ssd1306_i2c/README.adoc Outdated Show resolved Hide resolved
i2c/ssd1306_i2c/README.adoc Outdated Show resolved Hide resolved
i2c/ssd1306_i2c/README.adoc Outdated Show resolved Hide resolved
i2c/ssd1306_i2c/README.adoc Outdated Show resolved Hide resolved
@lurch
Copy link
Contributor

lurch commented May 11, 2022

No idea what people want to do with this.

That probably makes 4 of us? 😆
Does the code in this PR do anything significant that https://github.com/raspberrypi/pico-examples/tree/master/i2c/oled_i2c doesn't do?

@JamesH65
Copy link
Collaborator Author

Well, it's got a Bresenhams implementation and some font stuff that I will probably reuse elsewhere, but otherwise not a lot more or less than the other one. Might be worth combining the two...might look in to that.

@kilograham
Copy link
Contributor

can i close this?

@JamesH65
Copy link
Collaborator Author

Taken a look at both examples. They use the same controller, but different sized displays (128x32 vs 128x64). Init code is implemented differently. One does line drawing and text; one does sprites and scrolling.

So might be worth having both?

@JamesH65
Copy link
Collaborator Author

Worth noting that the other example was merged before requested alterations were made, and I would prefer that the name of the project reflected the driver being used (it's oled_I2c, rather than the more explanatory ssd1306_i2c for example). Rather inclined to merge the two together, fix up the requested changes and sort out naming at the same time.

@kilograham
Copy link
Contributor

ok, go ahead

@lurch
Copy link
Contributor

lurch commented May 16, 2022

Maybe you'd like to have a look at #202 as well @JamesH65 ?
(and see also #191 and #194 )

@JamesH65
Copy link
Collaborator Author

Yes, will do. Code does need fixing up for variable sized displays, my example is a different size.

@JamesH65
Copy link
Collaborator Author

Superseded by #217

@JamesH65 JamesH65 closed this May 25, 2022
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.

5 participants