Compare commits

...

No commits in common. "0.1.0" and "master" have entirely different histories.

5 changed files with 15 additions and 12 deletions

View File

@ -1,8 +1,6 @@
# Oled-EInk-RaspberryPi # RPiGPIO.makertools
OLED and E-Paper on RaspberryPi Python library for using the GPIO on RaspberryPi with examples.
A simple library with examples to use a Oled- or E-Ink-Display with RaspberryPi (Zero/2/3/4)
# Installation # Installation
To install the RPiGPIO.makertools library, you first have to clone the git repo: To install the RPiGPIO.makertools library, you first have to clone the git repo:
@ -15,6 +13,11 @@ python3 setup.py install
``` ```
This will copy the required package files to your python installation point (or, in case of a virtual environment, to the _lib_ directory of the env folder) and install all requirements. This will copy the required package files to your python installation point (or, in case of a virtual environment, to the _lib_ directory of the env folder) and install all requirements.
When you want to use devices which communicate over I²C, you probably first have to enable with `raspi-config`:
- _Interface Options_
- _I2C_
- **Yes** and **OK**
That's it! Now you can use the library in Python by importing it: That's it! Now you can use the library in Python by importing it:
```python3 ```python3
import RPiGPIOmakertools import RPiGPIOmakertools

View File

@ -26,7 +26,7 @@ SOFTWARE.
import smbus2 as smbus import smbus2 as smbus
class device(object): class Device(object):
""" """
Base class for OLED driver classes Base class for OLED driver classes
""" """

View File

@ -25,10 +25,10 @@ SOFTWARE.
import smbus2 as smbus import smbus2 as smbus
from PIL import Image, ImageDraw from PIL import Image, ImageDraw
from .I2C_DEVICE import device from .I2C_DEVICE import Device
class sh1106(device): class SH1106(Device):
""" """
A device encapsulates the I2C connection (address/port) to the SH1106 A device encapsulates the I2C connection (address/port) to the SH1106
OLED display hardware. The init method pumps commands to the display OLED display hardware. The init method pumps commands to the display
@ -38,7 +38,7 @@ class sh1106(device):
""" """
def __init__(self, port=1, address=0x3C): def __init__(self, port=1, address=0x3C):
super(sh1106, self).__init__(port, address) super(SH1106, self).__init__(port, address)
self.width = 128 self.width = 128
self.height = 64 self.height = 64
self.pages = round(self.height / 8) self.pages = round(self.height / 8)

View File

@ -25,10 +25,10 @@ SOFTWARE.
import smbus2 as smbus import smbus2 as smbus
from PIL import Image, ImageDraw from PIL import Image, ImageDraw
from .I2C_DEVICE import device from .I2C_DEVICE import Device
class ssd1306(device): class SSD1306(Device):
""" """
A device encapsulates the I2C connection (address/port) to the SSD1306 A device encapsulates the I2C connection (address/port) to the SSD1306
OLED display hardware. The init method pumps commands to the display OLED display hardware. The init method pumps commands to the display
@ -38,7 +38,7 @@ class ssd1306(device):
""" """
def __init__(self, port=1, address=0x3C): def __init__(self, port=1, address=0x3C):
super(ssd1306, self).__init__(port, address) super(SSD1306, self).__init__(port, address)
self.width = 128 self.width = 128
self.height = 64 self.height = 64
self.pages = round(self.height / 8) self.pages = round(self.height / 8)

View File

@ -7,7 +7,7 @@ setup(
author_email='bluefox@privacynerd.de', author_email='bluefox@privacynerd.de',
packages=['RPiGPIOmakertools'], packages=['RPiGPIOmakertools'],
license='LICENSE', license='LICENSE',
description='Library for communicating with OLED-, E-Ink-, TFT- and so on -displays. And some other useful stuff.', description='Library with some handy tools for working with GPIO',
install_requires=[ install_requires=[
"RPi.GPIO", "RPi.GPIO",
"Pillow", "Pillow",