Skip to content

Commit

Permalink
Edit readme
Browse files Browse the repository at this point in the history
  • Loading branch information
vickash committed Jul 28, 2024
1 parent 9a70bbe commit c405e0d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
# RotaryEncoderPCNT

This is a 2-channel rotary (quadrature) encoder implementation, for the ESP32, on the Arduino platform. It uses the ESP32's built in pulse counter (PCNT) peripheral.

Simply create a new `RotaryEncoderPCNT` object with the encoder's A and B pins, then call `.position()` to return the current position. The PCNT unit is set up to keep the encoder object updated in the background, handling interrupts, internal counter overflow, etc. for you.

Note: `.position()` returns a signed 32-bit integer. If you expect to overflow that, you need to handle it.
This is a 2-channel rotary (quadrature) encoder implementation, for the ESP32, on the Arduino platform. It uses the ESP32's built in pulse counter (PCNT) peripheral. The PCNT unit is set up to keep the encoder object updated in the background, handling interrupts, internal counter overflow, etc. for you.

### Compatibility
- Requires Arduino ESP32 Core 3.0 or higher
- Incompatible with ESP32-C2 and ESP32-C3, as they don't have PCNT units.

### Most Basic Example
```
```C++
#include <RotaryEncoderPCNT.h>

RotaryEncoderPCNT encoder(25, 12);
Expand All @@ -25,3 +21,7 @@ void loop(){
delay(200);
}
```
Note: `.position()` returns a signed 32-bit integer. If you expect to overflow that, you need to handle it.
See included example for more.

0 comments on commit c405e0d

Please sign in to comment.