Skip to main content

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

Release files for Encoder 1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Encoder 1.1
File Size Uploaded
Encoder-1.1.tar.gz 2.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Encoder 1.1
File Interpreter ABI Platform
Encoder-1.1-py3-none-any.whl Python 3 none any Details

Total release size: 5.0 kB

Release files / Encoder-1.1.tar.gz

Download URL Encoder-1.1.tar.gz
Size 2.1 kB
Tags Source
SHA-256 checksum
How to use checksums
46671bd66749a18b9f58277d52bf6cf5099f9292040fd2a953830b6899fb9b7a
BLAKE2b-256 checksum
How to use checksums
c5a08b9b80a87bbec32ec3e89d22e32cf9a9f6ab25fca264b461ace497657e02
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / Encoder-1.1-py3-none-any.whl

Download URL Encoder-1.1-py3-none-any.whl
Size 2.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6873ff4b3bb6201575719bd35b0028b0de7d1b0da186e4204570453a916346f3
BLAKE2b-256 checksum
How to use checksums
26b3969a8a7fe6fc17431eae032c56595f0c92b9cdec4dc594e324d3e93b1538
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

1.1 This release

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page