Compare commits
No commits in common. "0.1.0" and "master" have entirely different histories.
11
README.md
11
README.md
@ -1,8 +1,6 @@
|
||||
# Oled-EInk-RaspberryPi
|
||||
# RPiGPIO.makertools
|
||||
|
||||
OLED and E-Paper on RaspberryPi
|
||||
|
||||
A simple library with examples to use a Oled- or E-Ink-Display with RaspberryPi (Zero/2/3/4)
|
||||
Python library for using the GPIO on RaspberryPi with examples.
|
||||
|
||||
# Installation
|
||||
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.
|
||||
|
||||
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:
|
||||
```python3
|
||||
import RPiGPIOmakertools
|
||||
|
@ -26,7 +26,7 @@ SOFTWARE.
|
||||
import smbus2 as smbus
|
||||
|
||||
|
||||
class device(object):
|
||||
class Device(object):
|
||||
"""
|
||||
Base class for OLED driver classes
|
||||
"""
|
||||
|
@ -25,10 +25,10 @@ SOFTWARE.
|
||||
|
||||
import smbus2 as smbus
|
||||
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
|
||||
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):
|
||||
super(sh1106, self).__init__(port, address)
|
||||
super(SH1106, self).__init__(port, address)
|
||||
self.width = 128
|
||||
self.height = 64
|
||||
self.pages = round(self.height / 8)
|
||||
|
@ -25,10 +25,10 @@ SOFTWARE.
|
||||
|
||||
import smbus2 as smbus
|
||||
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
|
||||
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):
|
||||
super(ssd1306, self).__init__(port, address)
|
||||
super(SSD1306, self).__init__(port, address)
|
||||
self.width = 128
|
||||
self.height = 64
|
||||
self.pages = round(self.height / 8)
|
||||
|
2
setup.py
2
setup.py
@ -7,7 +7,7 @@ setup(
|
||||
author_email='bluefox@privacynerd.de',
|
||||
packages=['RPiGPIOmakertools'],
|
||||
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=[
|
||||
"RPi.GPIO",
|
||||
"Pillow",
|
||||
|
Loading…
Reference in New Issue
Block a user