Python Modules for the Servo, Relay, and OLED Expansions!
I finally got around to hooking up the OLED screen and playing around with it. I created a small, Python program to write a simple message to the screen. First, there are some random bits set on the right edge of the screen. Is this a hardware problem or a problem with the Python clear()?
#!/usr/bin/python import OmegaExpansion.oledExp as oled oled.driverInit() oled.setDisplayPower(1) oled.setDisplayMode(0) oled.clear() oled.setCursor(0, 0) oled.write("Hello") oled.setCursor(2,0) oled.write("World!")
Produces the following screen:
So is there a way to get rid of the pixels that are lit up?
Is there a way to write individual bytes (from Python) to produce my own characters?
Hi @Bryan-Hilterbrand, this problem should have been fixed a couple of weeks ago. Can you upgrade your Omega to the latest firmware with
Thanks @Boken-Lin! That fixed the garbage along the right side of the screen.
Now is there any chance I can get an interface to write a byte to an individual column and page? Extra credit if I can read the byte that is currently there!
@Bryan-Hilterbrand Ah, unfortunately we cannot read from the OLED via I2C. The closest thing we might be able to do is to keep track of the information that's on the screen in a variable and dump the variable out on demand. But this could back fire if you first print some text, and then upload a transparent image. On the screen you will see both the text and the image but in the memory buffer you would see only the image.
@Boken-Lin no problem on reading, but I'd still like a way to send a byte (or a list of bytes) to the screen. That would allow me to make my own fonts, special characters, or images to send to the OLED screen.
@Bryan-Hilterbrand Ok, I'll look into adding that feature in.
I'll let you know when its available
Thank you @Lazar-Demin!
The OLED Expansion library now supports writing individual bytes, along with some other features!
Check out the details here: https://community.onion.io/topic/560/python-module-for-i2c-oled-library-update
Hey @Lazar-Demin did you see my other post? The python library is seg faulting on setting pixel column, and the doc has typos in it.
@PK-Shiu Yep, there's two responses waiting for you in that thread.