ssd1351 python library for BBB and a question

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
akamediasystem
 
Posts: 79
Joined: Tue Apr 30, 2013 1:38 pm

ssd1351 python library for BBB and a question

Post by akamediasystem »

Hi, I've been hoping to use an Adafruit OLED with ssd1351 driver with my Beaglebone Black, so I made a couple of modifications to boxysean's library that can be found here: https://github.com/boxysean/py-gaugette ... er/samples

My version, which removes the need to install gaugette, can be found here: https://github.com/AKAMEDIASYSTEM/py-ssd1351

I must admit, I did a pretty dumb/brutal port, so not everything works just yet (I'll update here when it does!). Currently, I have a question about the color encoding...after reading the datasheet I'm still a little confused about how color encoding works.

For example, I sort of expected to pass it a value like 0xRRGGBB, where RR is a two-byte value indicating red intensity. However, despite some trial and error, I'm unable to get the screen to show full red (I can get green and blue, though!).

I'm sure this is a dumb oversight on my part, but I spent a couple hours on it today and am still perplexed. Anyone have any insight to offer?

Thanks!

AKA

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: ssd1351 python library for BBB and a question

Post by adafruit_support_rick »

The SSD1351 uses 16-bit color in a 565 arrangement. That is, the high 5 bits are the red component, the middle 6 bits are green, and the low 5 bits are blue.

User avatar
akamediasystem
 
Posts: 79
Joined: Tue Apr 30, 2013 1:38 pm

Re: ssd1351 python library for BBB and a question

Post by akamediasystem »

Thanks for the reply!

I had understood from the datasheet about the (to me, weird) 5-6-5 encoding - the problem ended up being that the library I was trying to port has an error:
This line, https://github.com/boxysean/py-gaugette ... 51.py#L212, results in double-encoding the incoming 0xRRGGBB value, and since the first step of encoding is to knock the RR values >> 16 bits, no reds were ever making it though!

Thanks again for the help,

AKA

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”