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

support 16-bit colour screens #11

Open
noopkat opened this issue Sep 29, 2014 · 2 comments
Open

support 16-bit colour screens #11

noopkat opened this issue Sep 29, 2014 · 2 comments

Comments

@noopkat
Copy link
Owner

noopkat commented Sep 29, 2014

No description provided.

@noopkat noopkat changed the title support colour support 16-bit colour screens Sep 29, 2014
@fabianschwarzfritz
Copy link

Hi @noopkat 👋 ,

I hope you don't mind my comment on the issue here. I'm fairly new to hardware. 😇

Currently, this project supports the SSD1306 Controller. This controller and the oled-js repo supports black and white. Colors are not supported.

To have support for colors, I would:

  1. have to add functionality to support different display sizes, like 128x128 or 96x64, as I have not seen any rgb oled displays with the screen sizes that are supported today by oled-js.
  2. Dig through the datasheet, find out how the colors are set.

Two questions:

  1. Can you give me a hint on which controller specification is a good start to test/implement colors on? Is it Adafruits SSD1331?
  2. A place to dig through the existing functionality in regards to drawing pixels with b/w (where color could be added) is here: oled.ts#L559 . Any other tips on where to get started?

Cheers, Fabian

@noopkat
Copy link
Owner Author

noopkat commented Apr 5, 2020

@fabianschwarzfritz thank you so much for your interest in supporting colour screens. I'll try my best to answer your questions below: 😄

  1. The SSD1331 controller is a great one to build support for, because it's quite common and it also has driver protocol similarities to SSD1306
  2. Yes, I had a look at the datasheet, and instead of 1 bit per pixel as I have coded in SSD1306 in this library, many bytes per pixel. The format is BGR (RGB backwards), and there are several different colour depths to consider. See the table from the datasheet below for reference:

data table showing different byte arrangements for differing colour depths

As for your set of questions:

  1. So it's really up to us how many depths we support. It might be cool to just focus on 16bit for now? I'd look at the python library that Adafruit have authored for reference and guidance here.

  2. It might be worth breaking up this library into different classes. The default class loaded would be the SSD1306, but a new property on the class instantiation could allow for specifying which one you want. A lot of the methods could be shared between the two different drivers (inherited off a base class), and because almost every graphics related method relies on drawPixel, this would be as you mentioned, the place to start for supporting colour pixels. So a seperate method here on the SSD1331 driver would be a good idea. I'm probably oversimplifying this you're definitely on the right track here.

Do you have a screen and an arduino board that you can test with? If not I am happy to ship you one (COVID-19 logistics allowing).

I'm also happy to test and continue to discuss this with you on this issue if you get stuck, or need me to start you off on anything 🙇‍♀

Thanks again, I am excited at the thought of this driver finally being supported in this library! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants