• Stars
    star
    193
  • Rank 201,081 (Top 4 %)
  • Language
    C++
  • License
    Other
  • Created about 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Quadrature and half quadrature PCNT peripheral driven encoder library supporting 8 encoders

ESP32Encoder

Build Status

ESP32Encoder library that uses the ESP32 pulse counter hardware peripheral:

https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/peripherals/pcnt.html

There is only one interrupt for the peripheral, and that is managed by the library. The user has no interrupt interface, and no interrupts are generated on each pulse. Interrupts arrive when the 16 bit counter buffer overflows, so this library has a tiny interrupt footprint while providing support for up to 8 simultaneous quadrature encoders.

This hardware peripheral supports only 8 encoders.

Support

ESP32 and ESP32c2 are supported.

ESP32c3 does not have pulse counter hardware.

Documentation by Doxygen

ESP32Encoder Doxygen

Quadrature Explanation

For information on the type of encoder this library is for, see: https://en.wikipedia.org/wiki/Incremental_encoder

The modes of reading encoders in this library are full and half quadrature, and single edge count mode.

Image

Full performs a count increment on all 4 edges, half on the rising and falling of a single channel, and single counts just the rising edge of the A channel.

Pull Downs/Ups

To specify the weak pull resistor set the value useInternalWeakPullResistors with the enum types UP, DOWN, or NONE

ISR service CPU core

To specify the CPU core for the PCNT ISR service set the value isrServiceCpuCore to the desired core number. This can be usefull to prevent concurrency problems where the total count might not be updated correctly yet while it is read.

A note on KY-040 and similar

The "switch style" encoder wheels used by breakout modules such as:

https://usa.banggood.com/KY-040-360-Degrees-Rotary-Encoder-Module-with-1516_5mm-Potentiometer-Rotary-Knob-Cap-for-Brick-Sensor-Switch-p-1677837.html

need electrical debouncing in the range of 0.1 - 2 uf per encoder line to ground. This device bounces much more than the PCNT hardware modules debouncing time limits. Be sure to setFilter() to 1023 as well after attaching in order to get the maximum hardware debouncing.

More Repositories

1

WiiChuck

A library to provide Wii accessory access to arduino devices Via Wire.
C++
42
star
2

Esp32WifiManager

A wifi manager for passwords, multi network fail over, AP mode fail over and reconnection.
C++
40
star
3

ESP32AnalogRead

Load the calibration data and provide a calibrated analog read
C++
22
star
4

EspWii

A framework for controlling one ESP from another using various Wii accessories.
C++
9
star
5

SeriesElasticActuator

A cad generator for series elastic actuator modules
Groovy
8
star
6

ESP32ServoServer

A simplePacketComs server for servos on ESP32
C++
7
star
7

TeensySimplePacketComs

A library for using Simple Packet Coms on the Teensy microcontrolers
C++
3
star
8

Esp32SimplePacketComs

SimplePacketComs for the Esp32
C++
3
star
9

GearGenerator

A parametric gear generator
Groovy
3
star
10

ESP32TimerExample

A project to demonstrate esp 32 mutex gaurds
C++
3
star
11

SimplePacketComs

A simple packet comms library
C++
3
star
12

OpenParaPros

A set of .scad scripts to generate prostetic cups fitted to 3d scans of residual limbs.
OpenSCAD
2
star
13

BowlerStudioImageAssets

An assets library for extensible and mod-able assets
CSS
2
star
14

Halloween2016

A repository for my 2016 Halloween costume
C
2
star
15

BNO055SimplePacketComs

A simple Packet coms Server for the BNO055
C++
2
star
16

ESP32WebRemoteControl

A web based RC control stack for ESP32
C
2
star
17

VexVitaminScripts

BowlerStudio scripts to generate vex parts
Groovy
2
star
18

SVGBowlerExtrude

Groovy
1
star
19

MediumKat_copy

MediumKat_copy copy of MediumKat
Groovy
1
star
20

Fanuc_SR_12ia-Scara

Scara Fanuc robot
Groovy
1
star
21

brushlessMotorCadGenerator

brushlessMotorCadGenerator Generates CAD vitamins
Groovy
1
star
22

KevinKat

KevinKat copy of MediumKat
Groovy
1
star
23

6dofServoArm

6dofServoArm copy of MediumKat
Groovy
1
star
24

teeNutWithProngsCadGenerator

teeNutWithProngsCadGenerator Generates CAD vitamins
Groovy
1
star
25

LaputaRobotHead

A test of SVG extrusion to make complex shapes
Groovy
1
star
26

HIDSmallKat

HIDSmallKat copy of HIDSmallKat
Groovy
1
star
27

Standard6dof_copy

Standard6dof_copy copy of Standard6dof
Groovy
1
star
28

oRingCadGenerator

oRingCadGenerator Generates CAD vitamins
Groovy
1
star
29

KevKat2

KevKat2 copy of MediumKat
Groovy
1
star
30

jni-template

Automatically exported from code.google.com/p/jni-template
C
1
star
31

brushlessCadGenerator

brushlessCadGenerator Generates CAD vitamins
1
star
32

ParametricAnimatronics

A script to create laser cut animatronic heads using BowlerStudio.
Groovy
1
star
33

LewanSoulHornCadGenerator

LewanSoulHornCadGenerator Generates CAD vitamins
Groovy
1
star
34

epilogCLI

A CLI system for Epilog laser cutters
C
1
star
35

SerialInspector

A utility for inspecting serial port data that is both ASCII and binary mixed together.
Java
1
star
36

DSLForPollice

Groovy
1
star
37

SimplePacketComsJava-HID

HID implementation of Simple Packet Coms
Java
1
star
38

BevelGearWristModule

A module to for a spherical 2 dof wrist.
Groovy
1
star
39

harrington-crest

Harrington family crest
1
star
40

CorsetParametric

A corset pattern that is parametric to measurments
Groovy
1
star
41

carl-the-hexapod

A standard hexapod implementation with cad and gait generation.
Groovy
1
star
42

RobotMesh

C++
1
star
43

Kronenberg

Kronenberg copy of CarlTheWalkingRobot
Groovy
1
star
44

brushlessBoltOnShaftCadGenerator

brushlessBoltOnShaftCadGenerator Generates CAD vitamins
Groovy
1
star
45

SmallKatGenerated

SmallKatGenerated copy of MediumKat
Groovy
1
star
46

SmallKatFootTest

test the algo for making the thumbstick covered feet
Groovy
1
star
47

BowlerParalellRobot

1
star
48

LewanSoulMotorCadGenerator

LewanSoulMotorCadGenerator Generates CAD vitamins
Groovy
1
star