Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jkawamoto/i2cdisplay

A Python library for LCDs connected via I2C.
https://github.com/jkawamoto/i2cdisplay

Last synced: 13 days ago
JSON representation

A Python library for LCDs connected via I2C.

Awesome Lists containing this project

README

        

i2cdisplay
==========
[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)
[![Code Climate](https://codeclimate.com/github/jkawamoto/i2cdisplay/badges/gpa.svg)](https://codeclimate.com/github/jkawamoto/i2cdisplay)

A Python library for LCDs connected via I2C.
Now, this library supports LCDs with SpikenzieLabs's [MPTH](https://www.spikenzielabs.com/SpikenzieLabs/MPTH.html).

Useage
------
Initialize with bus number `` and device address ``.
You can find those parameters by `sudo i2cdetect 0` and/or `sudo i2cdetect 1`.

```python
d = MPTHDisplay(, )
```

Then, you can write strings, new lines, and clear them.

```python
# Write a single string.
d.write("Hello")

# Write a new line and another string.
d.newline()
d.write("MPTH")

# Clear display.
d.clear()

# Write multi strings.
d.writelines(["Hello", "world"])
```

As a command
-------------
Basic formula is `./i2cdisplay.py {write|clear|cursor|backlight}`
where `` and `` are the bus number and address of the display.
You also need to run this command as root.

This command has four sub commands; write, clear, cursor, backlight.

### write
Write mult lines.

```sh
./i2cdisplay.py write "abc" "def"
```

### clear
Clear display.

```sh
./i2cdisplay.py clear
```

### cursor
Turn on/off cursor.

```sh
# Turn on
./i2cdisplay.py cursor True
# Turn off
./i2cdisplay.py cursor False
```

### backlight
Change backlight's brightness.

```sh
./i2cdisplay.py backlight 128 # Chose from 0-255
```

License
--------
This software is released under the MIT License, see LICENSE.