MicroPython SSD1306
===================
|Version| |License|
MicroPython Library for SSD1306 OLED Displays with some simple shape
drawing functions.
https://github.com/PerfecXX/MicroPython-SSD1306
Example Usage
=============
- `Screen
Control <https://github.com/PerfecXX/MicroPython-SSD1306/tree/main/example/i2c/screen%20control>`__
- `Text <https://github.com/PerfecXX/MicroPython-SSD1306/tree/main/example/i2c/text>`__
- `Shape <https://github.com/PerfecXX/MicroPython-SSD1306/tree/main/example/i2c/shape>`__
- `Image <https://github.com/PerfecXX/MicroPython-SSD1306/tree/main/example/i2c/image>`__
- `QRCode <https://github.com/PerfecXX/MicroPython-SSD1306/tree/main/example/i2c/QRCode>`__
- `More
Example <https://github.com/PerfecXX/MicroPython-SSD1306/tree/main/example>`__
Quick Example
=============
.. code:: python
# Import Library
from machine import Pin,SoftI2C
from ssd1306 import SSD1306_I2C
from time import sleep,sleep_us
# Pin Setup
screen_width = 128
screen_height = 64
i2c = SoftI2C(scl=Pin(22), sda=Pin(21))
oled = SSD1306_I2C(screen_width, screen_height, i2c)
#---Turn on the oled---
oled.poweron()
oled.contrast(0)
#---Show Text---
oled.text("...Test Begin...",0,0)
oled.text("Contrast LV",20,20)
oled.show()
sleep(1)
#---Show Contrast Level---
for contrast_level in range(0,256,1):
oled.contrast(contrast_level)
oled.text("LV:{}".format(contrast_level),50,40,1)
oled.show()
oled.text("LV:{}".format(contrast_level),50,40,0)
sleep_us(1)
sleep(1)
#---Fill Screen (clear screen)---
oled.fill(0)
oled.show()
sleep(1)
#---Invert Screen---
oled.text("Color Inverted!",0,5)
oled.invert(1)
oled.show()
sleep(1)
# Scroll Text (Right->Left)
for x in range(0,128):
oled.fill(0)
oled.text("Scroll Text", 128 - x, 10)
oled.show()
sleep(0.01)
# Scroll Text (Left->Right)
for x in range(0,128):
oled.fill(0)
oled.text("Scroll Text",x, 10)
oled.show()
sleep(0.01)
#---Draw line---
oled.fill(0)
oled.text("Line",50,10)
oled.hline(0,30,100,1) # Horizontal Line
oled.vline(64,25,60,1) # Vertival Line
oled.show()
sleep(1)
#---Draw a Triangle---
oled.fill(0)
oled.text("Triangle",25,5)
oled.triangle(30, 20, 60, 60, 90, 20, color=1, fill=False) # Outline
oled.show()
sleep(1)
oled.triangle(30, 20, 60, 60, 90, 20, color=1, fill=True) #Filled
oled.show()
sleep(1)
#---Draw a Rectangle---
oled.fill(0)
oled.text("Rectangle",25,5)
oled.rect(3,15,20,20,1,0) # Outline
oled.show()
oled.rect(3,40,20,20,1,1) # Filled
oled.show()
sleep(1)
#---Draw a Round Rectangle---
oled.fill(0)
oled.text("Round Rectangle",5,5)
oled.round_rect(10, 20, 60, 40, 1, filled=False , radius=10) # Outline
oled.show()
sleep(1)
Useful Link & Tools
===================
- `External QRCode Library <https://github.com/JASchilz/uQR>`__
- This library is used to generate a QR code matrix and render it to
the SSD1306.
- `Image to Matrix Generator <https://jlamch.net/MXChipWelcome/>`__
- This link is used to convert images into byte arrays and render
them to the SSD1306.
.. |Version| image:: https://img.shields.io/badge/version-1.0.2-green.svg
:target: https://github.com/PerfecXX/MicroPython-SSD1306
.. |License| image:: https://img.shields.io/badge/license-MIT-green.svg
:target: https://opensource.org/licenses/MIT
Raw data
{
"_id": null,
"home_page": "https://github.com/PerfecXX/MicroPython-SSD1306",
"name": "micropython-ssd1306-driver",
"maintainer": "Teeraphat Kullanankanjana",
"docs_url": null,
"requires_python": null,
"maintainer_email": "ku.teeraphat@hotmail.com",
"keywords": "oled, ssd1306, esp32, micropython",
"author": "Teeraphat Kullanankanjana",
"author_email": "ku.teeraphat@hotmail.com",
"download_url": "https://files.pythonhosted.org/packages/88/c5/357ba67f6ab776595f3ae838fc6abe35d1c1742fded563c25e9c6ead8b8f/micropython-ssd1306-driver-1.0.2.tar.gz",
"platform": null,
"description": "MicroPython SSD1306\r\n===================\r\n\r\n|Version| |License|\r\n\r\nMicroPython Library for SSD1306 OLED Displays with some simple shape\r\ndrawing functions.\r\n\r\nhttps://github.com/PerfecXX/MicroPython-SSD1306\r\n\r\nExample Usage\r\n=============\r\n\r\n- `Screen\r\n Control <https://github.com/PerfecXX/MicroPython-SSD1306/tree/main/example/i2c/screen%20control>`__\r\n- `Text <https://github.com/PerfecXX/MicroPython-SSD1306/tree/main/example/i2c/text>`__\r\n- `Shape <https://github.com/PerfecXX/MicroPython-SSD1306/tree/main/example/i2c/shape>`__\r\n- `Image <https://github.com/PerfecXX/MicroPython-SSD1306/tree/main/example/i2c/image>`__\r\n- `QRCode <https://github.com/PerfecXX/MicroPython-SSD1306/tree/main/example/i2c/QRCode>`__\r\n- `More\r\n Example <https://github.com/PerfecXX/MicroPython-SSD1306/tree/main/example>`__\r\n\r\nQuick Example\r\n=============\r\n\r\n.. code:: python\r\n\r\n # Import Library\r\n from machine import Pin,SoftI2C\r\n from ssd1306 import SSD1306_I2C\r\n from time import sleep,sleep_us\r\n\r\n # Pin Setup\r\n screen_width = 128\r\n screen_height = 64\r\n i2c = SoftI2C(scl=Pin(22), sda=Pin(21))\r\n oled = SSD1306_I2C(screen_width, screen_height, i2c)\r\n\r\n #---Turn on the oled---\r\n oled.poweron()\r\n oled.contrast(0)\r\n\r\n #---Show Text---\r\n oled.text(\"...Test Begin...\",0,0)\r\n oled.text(\"Contrast LV\",20,20)\r\n oled.show()\r\n sleep(1)\r\n\r\n #---Show Contrast Level---\r\n for contrast_level in range(0,256,1):\r\n oled.contrast(contrast_level)\r\n oled.text(\"LV:{}\".format(contrast_level),50,40,1)\r\n oled.show()\r\n oled.text(\"LV:{}\".format(contrast_level),50,40,0)\r\n sleep_us(1)\r\n sleep(1)\r\n\r\n #---Fill Screen (clear screen)---\r\n oled.fill(0)\r\n oled.show()\r\n sleep(1)\r\n\r\n #---Invert Screen---\r\n oled.text(\"Color Inverted!\",0,5)\r\n oled.invert(1)\r\n oled.show()\r\n sleep(1)\r\n\r\n # Scroll Text (Right->Left)\r\n for x in range(0,128):\r\n oled.fill(0)\r\n oled.text(\"Scroll Text\", 128 - x, 10)\r\n oled.show()\r\n sleep(0.01)\r\n\r\n # Scroll Text (Left->Right)\r\n for x in range(0,128):\r\n oled.fill(0)\r\n oled.text(\"Scroll Text\",x, 10)\r\n oled.show()\r\n sleep(0.01)\r\n\r\n #---Draw line---\r\n oled.fill(0)\r\n oled.text(\"Line\",50,10)\r\n oled.hline(0,30,100,1) # Horizontal Line\r\n oled.vline(64,25,60,1) # Vertival Line\r\n oled.show()\r\n sleep(1)\r\n\r\n\r\n #---Draw a Triangle---\r\n oled.fill(0)\r\n oled.text(\"Triangle\",25,5)\r\n oled.triangle(30, 20, 60, 60, 90, 20, color=1, fill=False) # Outline\r\n oled.show()\r\n sleep(1)\r\n oled.triangle(30, 20, 60, 60, 90, 20, color=1, fill=True) #Filled\r\n oled.show()\r\n sleep(1)\r\n\r\n #---Draw a Rectangle---\r\n oled.fill(0)\r\n oled.text(\"Rectangle\",25,5)\r\n oled.rect(3,15,20,20,1,0) # Outline\r\n oled.show()\r\n oled.rect(3,40,20,20,1,1) # Filled\r\n oled.show()\r\n sleep(1)\r\n\r\n #---Draw a Round Rectangle---\r\n oled.fill(0)\r\n oled.text(\"Round Rectangle\",5,5)\r\n oled.round_rect(10, 20, 60, 40, 1, filled=False , radius=10) # Outline\r\n oled.show()\r\n sleep(1)\r\n\r\nUseful Link & Tools\r\n===================\r\n\r\n- `External QRCode Library <https://github.com/JASchilz/uQR>`__\r\n\r\n - This library is used to generate a QR code matrix and render it to\r\n the SSD1306.\r\n\r\n- `Image to Matrix Generator <https://jlamch.net/MXChipWelcome/>`__\r\n\r\n - This link is used to convert images into byte arrays and render\r\n them to the SSD1306.\r\n\r\n.. |Version| image:: https://img.shields.io/badge/version-1.0.2-green.svg\r\n :target: https://github.com/PerfecXX/MicroPython-SSD1306\r\n.. |License| image:: https://img.shields.io/badge/license-MIT-green.svg\r\n :target: https://opensource.org/licenses/MIT\r\n\r\n\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "MicroPython Library for SSD1306 OLED Displays with some simple shape drawing functions.",
"version": "1.0.2",
"project_urls": {
"Homepage": "https://github.com/PerfecXX/MicroPython-SSD1306"
},
"split_keywords": [
"oled",
" ssd1306",
" esp32",
" micropython"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "88c5357ba67f6ab776595f3ae838fc6abe35d1c1742fded563c25e9c6ead8b8f",
"md5": "ee56d48b077ccac88c558a3305483026",
"sha256": "d3c11809537ec91c6fc7d3b1a8d59fe9062c1cd6512bb5bdc0569181ab6408a9"
},
"downloads": -1,
"filename": "micropython-ssd1306-driver-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "ee56d48b077ccac88c558a3305483026",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8873,
"upload_time": "2024-12-25T10:00:04",
"upload_time_iso_8601": "2024-12-25T10:00:04.889251Z",
"url": "https://files.pythonhosted.org/packages/88/c5/357ba67f6ab776595f3ae838fc6abe35d1c1742fded563c25e9c6ead8b8f/micropython-ssd1306-driver-1.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-25 10:00:04",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "PerfecXX",
"github_project": "MicroPython-SSD1306",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "micropython-ssd1306-driver"
}