• Stars
    star
    109
  • Rank 317,098 (Top 7 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A fork of the driver for SSD1306 displays to make it installable via upip

micropython-ssd1306

This is a fork of the driver for SSD1306 displays which is hosted in the Micropython package. The purpose of this fork is to make the driver available on PyPi and thus installable via the upip package manager.

Installation

Use the upip package manager:

upip.install('micropython-ssd1306')

If your board or your computer doesn't have an active internet connection you can also clone this project on your local drive and copy the ssd1306.py to your board.

Example Usage

This shows an example usage on an ESP32 board with an SSD1306 display with an resolution of 128x32 pixels. The display is connected via I2C. On the ESP32 the I2C pins are: SDA: 23, SCL: 22.

First we set up the I2C bus on our ESP32 and scan for devices.

>>> import machine
>>> i2c = machine.I2C(sda=machine.Pin(23), scl=machine.Pin(22))
>>> i2c.scan()
[60]

This shows us that there is a device on address 60 which is 3C in Hex. That is where our display is supposed to live. Now we create an object for our OLED display.

>>> from ssd1306 import SSD1306_I2C
>>> oled = SSD1306_I2C(128, 32, i2c)

This is it. Now we can use our OLED display:

>>> oled.fill(1)
>>> oled.show()

This fills the whole display with white pixels. To clear the display do:

>>> oled.fill(0)
>>> oled.show()

Now we can also write some text:

>>> oled.text('Hello', 0, 0)
>>> oled.text('World', 0, 10)
>>> oled.show()

Find more information on how to use the SSD1306 on the great tutorial about the OLED featherwing from Adafruit.

More Repositories

1

pyads

Python wrapper for TwinCAT ADS
Python
249
star
2

Flask-MQTT

Flask Extension for the MQTT protocol
Python
207
star
3

pdftools

small collection of python scripts for pdf manipulation
Python
92
star
4

arduino_plclib

An Arduino library with the basic PLC functions and function blocks referred to in IEC61131-3.
C++
21
star
5

flask_docker

Small project that shows how to run Flask in a Docker container.
HTML
4
star
6

mkdocs-rtd-lightbox

Readthedocs theme for mkdocs with Lightbox support
HTML
4
star
7

flask-admin-examples-images

Python
4
star
8

esp8266_iot_nodes

A collection of IoT Clients using MQTT based on Micropython
Python
3
star
9

netset.py

A Network configuration tool for the commandline.
Python
3
star
10

cookiecutter-flask

Cookiecutter template for Flask projects
Python
2
star
11

webloc_to_url

Python script for converting Mac *.webloc files to Windows *.url files
Python
2
star
12

arduino_utillib

Utility library for Arduino
C++
2
star
13

bellwatcher

simple bell logger
Python
2
star
14

rpi_epaper_weatherstation

Weatherstation made with a Raspberry Pi Zero W, a Waveshare e-paper display and OpenWeatherMap.
Python
2
star
15

ml_facial-keypoints-recognition

Machine learning project for recognizing facial keypoints
Jupyter Notebook
2
star
16

picamera

Camera with Flask Webserver on Raspberry Pi Zero W
Python
2
star
17

articlefinder

Python
1
star
18

flask-stubs

Stubs for the Flask microframework
Python
1
star
19

sublime-black

Sublimetext plugin for Black - the uncompromising Python formatter
Python
1
star
20

django_polls

test app for django
Python
1
star
21

flask-mega-tutorial

My version of the micorblog of Miguel Grinbergs Flask Mega Tutorial
Python
1
star
22

jsonwatch

package for keeping track of data provided by a json string
Python
1
star
23

custom_bootstrap

My custom bootstrap boilerplate
HTML
1
star
24

mc

Midnight Commander Config Files
1
star
25

flaskmeter

HTML
1
star
26

python_snippets

Useful Python Snippets
Python
1
star
27

flask-boilerplate

A boilerplate for my Flask projects
HTML
1
star
28

pyscripts

a collection of python scripts
Python
1
star
29

flaskhab

Home Automation Base made with Flask
Python
1
star
30

qthmi.main

Python
1
star
31

arduino_pidctrl

PID controller library for Arduino
C++
1
star
32

qthmi.ads

Python
1
star
33

makesprites.py

Script for easy and flexible sprite generation.
Python
1
star