Encoder library for Raspberry Pi for measuring quadrature encoded signals.
Project description
Raspberry Pi Rotary Encoder Library
Encoder library for Raspberry Pi for measuring quadrature encoded signals.
About
Encoder class allows to work with rotary encoder which connected via two pin A and B (EN11 for example). Works only on interrupts because all RPi pins allow that. This library is a simple port of the Arduino Encoder library (https://github.com/PaulStoffregen/Encoder)
Installation
$ pip install Encoder
Usage
To use it, you need to connect pins A and B and GND of the rotary encoder to two pins and GND of the Raspberry Pi, for example 24 and 10. Then just use it:
import Encoder
enc = Encoder.Encoder(24, 10)
enc.read()
You can use two or more rotary encoders:
import Encoder
enc_1 = Encoder.Encoder(24, 10)
enc_2 = Encoder.Encoder(25, 9)
Note
If the encoder works in the wrong direction, for example, it reduces the position when turning clockwise, you just need to swap pins A and B in the code.
License
MIT
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
Built Distribution
File details
Details for the file Encoder-1.1.tar.gz
.
File metadata
- Download URL: Encoder-1.1.tar.gz
- Upload date:
- Size: 2.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46671bd66749a18b9f58277d52bf6cf5099f9292040fd2a953830b6899fb9b7a |
|
MD5 | 34b69240c652a137e024a2e40e41ca92 |
|
BLAKE2b-256 | c5a08b9b80a87bbec32ec3e89d22e32cf9a9f6ab25fca264b461ace497657e02 |
File details
Details for the file Encoder-1.1-py3-none-any.whl
.
File metadata
- Download URL: Encoder-1.1-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6873ff4b3bb6201575719bd35b0028b0de7d1b0da186e4204570453a916346f3 |
|
MD5 | 6948d2d7c8263aebda84b59f187c2866 |
|
BLAKE2b-256 | 26b3969a8a7fe6fc17431eae032c56595f0c92b9cdec4dc594e324d3e93b1538 |