Display-o-Tron 3000 Driver
Project description
# dot3k
## Hardware Requirements
You'll need to enable spi.
```bash
sudo raspi-config
```
Then head into `Advanced Options -> SPI -> Yes`.
And i2c.
```bash
sudo nano /etc/modprobe.d/raspi-blacklist.conf
```
And comment out (place a `#` before):
```
blacklist i2c-bcm2708
```
And also:
```bash
sudo nano /etc/modules
```
Add the line:
```
i2c-dev
```
Reboot to make these changes take effect:
```bash
sudo reboot
```
## Software Requirements
Next you should install python-smbus and python-dev via apt:
```bash
sudo apt-get install python-smbus python-dev
```
And pip, if you don't have it:
```bash
sudo apt-get install python-pip
```
Then install st7036 and sn3218 using pip:
```bash
sudo pip install st7036 sn3218
```
You can run the `requirements.sh` file to do this for you!
## Usage
### LCD
```python
from dot3k import lcd
lcd.write('Hello World!')
```
### Backlight
```python
from dot3k import backlight
backlight.sweep(0.5)
backlight.update()
```
### Joystick
```python
from dot3k import joystick
@joystick.on(joystick.UP)
def handle_joystick_up(pin):
print("Joystick up!")
```
Changelog
---------
1.8.0
-----
* Significant, possibly breaking, change to __init__.py to remove redundant imports
* lcd and joystick should work with Python 3, backlight still requires smbus
1.7.1
-----
* Sane defaults for write_option(), now no longer defauts to 1 margin and blank icon
1.7
---
* Added input handling plugin support
* Remapped parameters to args/kwargs to make menu initialisation less mystifying
1.6.1
-----
* Fixed bug in set_bar which cased the left blue backlight to light
1.6
---
* Added support for an "idle" plugin which shows after a customisable amount of seconds
1.5
---
* Fixed joystick repeat using delta timing instead of delays
1.4
---
* Bugfix of menu.py line-endings
* Attempt to fix joystick.repeat to prevent multiple repeats firing at once
1.3
---
* Removed plugins from dot3k.menu into examples/plugins folder
1.2
---
* Breaking changes with plugin compatibility vs version 1.1
* Many fixes to redraw calls
* Plugin redraw method is now passed the "menu" instance
1.1
---
* Fix for joystick on Rev 1 Pi
1.0dev
------
* Initial Release
## Hardware Requirements
You'll need to enable spi.
```bash
sudo raspi-config
```
Then head into `Advanced Options -> SPI -> Yes`.
And i2c.
```bash
sudo nano /etc/modprobe.d/raspi-blacklist.conf
```
And comment out (place a `#` before):
```
blacklist i2c-bcm2708
```
And also:
```bash
sudo nano /etc/modules
```
Add the line:
```
i2c-dev
```
Reboot to make these changes take effect:
```bash
sudo reboot
```
## Software Requirements
Next you should install python-smbus and python-dev via apt:
```bash
sudo apt-get install python-smbus python-dev
```
And pip, if you don't have it:
```bash
sudo apt-get install python-pip
```
Then install st7036 and sn3218 using pip:
```bash
sudo pip install st7036 sn3218
```
You can run the `requirements.sh` file to do this for you!
## Usage
### LCD
```python
from dot3k import lcd
lcd.write('Hello World!')
```
### Backlight
```python
from dot3k import backlight
backlight.sweep(0.5)
backlight.update()
```
### Joystick
```python
from dot3k import joystick
@joystick.on(joystick.UP)
def handle_joystick_up(pin):
print("Joystick up!")
```
Changelog
---------
1.8.0
-----
* Significant, possibly breaking, change to __init__.py to remove redundant imports
* lcd and joystick should work with Python 3, backlight still requires smbus
1.7.1
-----
* Sane defaults for write_option(), now no longer defauts to 1 margin and blank icon
1.7
---
* Added input handling plugin support
* Remapped parameters to args/kwargs to make menu initialisation less mystifying
1.6.1
-----
* Fixed bug in set_bar which cased the left blue backlight to light
1.6
---
* Added support for an "idle" plugin which shows after a customisable amount of seconds
1.5
---
* Fixed joystick repeat using delta timing instead of delays
1.4
---
* Bugfix of menu.py line-endings
* Attempt to fix joystick.repeat to prevent multiple repeats firing at once
1.3
---
* Removed plugins from dot3k.menu into examples/plugins folder
1.2
---
* Breaking changes with plugin compatibility vs version 1.1
* Many fixes to redraw calls
* Plugin redraw method is now passed the "menu" instance
1.1
---
* Fix for joystick on Rev 1 Pi
1.0dev
------
* Initial Release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dot3k-1.8.0.tar.gz
(8.2 kB
view details)
File details
Details for the file dot3k-1.8.0.tar.gz
.
File metadata
- Download URL: dot3k-1.8.0.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 453a29a620cc503fca9c8fac266d643f859096505583a8c29ecba3797e727894 |
|
MD5 | 2f5102e889777617e835e60351978ab7 |
|
BLAKE2b-256 | ce29e6a595234566f4a6ad9fef49ccf0b3988c0ca704dd8a6edd6a21d717d273 |