Skip to main content

driver for micropython compatible with ssd1306 OLED displays.

Project description

SSD1306 Library

This repository contains a modified version of the micropython-ssd1306 library with the main objective of simplifying the installation process. This project has removed support for SPI and retains only the I2C functionality from the original library. All credits and acknowledgments go to the original author.

The focus of this repository is to prepare the library for uploading to PyPI and renaming it before the upload.

Test for the DUALMCU board:

import machine

i2c = machine.I2C(0, sda=machine.Pin(21), scl=machine.Pin(22))

print(i2c.scan())

thonny install

The next diagram illustrates the communication between one of the two microcontrollers and the ability to display a default text on the OLED screen.

Code example

'''
    Unit Electronics 2023
           (o_
    (o_    //\
    (/)_   V_/_ 
    tested code mark
    version: 0.0.1
    revision: 0.0.1

'''

import machine
from ocks import SSD1306_I2C

i2c = machine.I2C(0,sda=machine.Pin(21), scl=machine.Pin(22))

oled = SSD1306_I2C(128, 32, i2c)

oled.fill(1)
oled.show()

oled.fill(0)
oled.show()
oled.text('UNIT', 50, 10)
oled.text('ELECTRONICS', 25, 20)

oled.show()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ocks-0.4.tar.gz (4.0 kB view hashes)

Uploaded Source

Built Distribution

ocks-0.4-py3-none-any.whl (4.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page