gbr1 / rp2040-encoder-library

Arduino quadrature encoder library based on RPI Pico pio example
GNU Lesser General Public License v3.0
19 stars 1 forks source link

rp2040-encoder-library

Arduino quadrature encoder library based on RPI Pico PIO example.

License: LGPL v3

This library allows to read and reset any quadrature encoder attached to a RP2040 mcu.

PioEncoder encoder(<first pin>);

void setup(){
    encoder.begin();
}

void loop(){

    ...

    int counts = encoder.getCount();

    ...

    encoder.reset();

    ...
}

Note: encoder pins must be consecutive (e.g. 2 and 3, 10 and 11 etc.)

Copyright © 2023 G. Bruno - gbr1.github.io