/acme-oled

Python library to control an SSD1325 based OLED monochrome screen with a 16 level grayscale.

Primary LanguagePythonMIT LicenseMIT

acme-oled

Summary

This library is a port of other libraries written in C and Python for this type of screen. It adds some funcionalities not present in Python simple libraries, and also ports some present on C libraries. More important, almost all libraries target the Raspberry Pi, Arduino or even BeagleBone Black, while there seems to be a lack of support for Acme Systems boards. This library targets the Aria G25 specifically, but can be easily adapted to any other (not only Acme ones) by changing some settings.

Example usage

Create a new bus:

spibus0 = spibus(32766,0)

Initialize the screen:

spibus0.oled_init()

Set overflow modes to control how to present long lines.

spibus0.set_overflow_mode(1, 1)

Write a pixel:

spibus0.write_pixel(X, Y, grayLevel)

Write a char:

spibus0.write_char(X, Y, grayLevel)

Write a string:

spibus0.write_string(X, Y, string)

Write a paragraph separated by "\n":

text = "This is the first line of the paragraph.\nThis is the second one."
spibus0.write_paragraph(text)

Update display:

spibus0.spi_write_80()

Scroll if necessary:

if spibus0.y_cursor > 64:
	spibus0.set_vertical_scroll(0x00, 3, 2, 200)

License

acme-oled is distributed under the MIT license.