Skip to content

Commit c405e0d

Browse files
committed
Edit readme
1 parent 9a70bbe commit c405e0d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
# RotaryEncoderPCNT
22

3-
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.
4-
5-
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.
6-
7-
Note: `.position()` returns a signed 32-bit integer. If you expect to overflow that, you need to handle it.
3+
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.
84

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

139
### Most Basic Example
14-
```
10+
```C++
1511
#include <RotaryEncoderPCNT.h>
1612

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

0 commit comments

Comments
 (0)