Skip to content

Encoder library for Raspberry Pi for measuring quadrature encoded signals.

License

Notifications You must be signed in to change notification settings

mivallion/Encoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Encoder library for Raspberry Pi for measuring quadrature encoded signals.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages