-
Notifications
You must be signed in to change notification settings - Fork 838
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
Conversation
int fb_idx = y * 128 + x; | ||
|
||
for (int i=0;i<8;i++) { | ||
uint16_t w = ExpandByte(reversed[idx * 8 + i]); |
There was a problem hiding this comment.
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? 🤷♂️
There was a problem hiding this comment.
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.....
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. |
Looks like you need to rebase this to the latest |
is this now obsolete? |
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. |
I think if you rebase it against the current |
IIRC, I specifically didn't use the default defines because variety is the spice of life. |
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 just to link back. We duplicated, see #130. 🤦♂️ |
I thought this had been merged.... |
It can't (yet) be merged because it still needs to be rebased against the latest |
@kilograham This looks to be a semi-sorta-duplicate of #130 which did (will be?) merged when the |
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.
I've updating to latest develop, but this does cross with the other example. No idea what people want to do with this. |
Ah, pushed to a new branch instead of my personal repo. https://github.com/raspberrypi/pico-examples/tree/ssd1306 |
Now pushed to correct branch. |
That probably makes 4 of us? 😆 |
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. |
can i close this? |
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? |
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. |
ok, go ahead |
Yes, will do. Code does need fixing up for variable sized displays, my example is a different size. |
Superseded by #217 |
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.