cu-rp-encoder

Crates.iocu-rp-encoder
lib.rscu-rp-encoder
version0.9.1
created_at2024-09-30 20:57:40.318215+00
updated_at2025-09-12 20:28:28.881533+00
descriptionThis is a driver for the Raspberry Pi to decode a directional encoder from GPIOs.
homepagehttps://github.com/copper-project
repositoryhttps://github.com/copper-project/copper-rs
max_upload_size
id1392205
size1,486,822
Guillaume Binet (gbin)

documentation

README

Raspberry Pi based encoder driver for Copper

This driver is for the Raspberry Pi based encoder driver for Copper.

Compatibility

Any encoder with a base clock + a direction trigger.

Usage

Add the driver like any other source in Copper:

    tasks: [
        (
            id: "src",
            type: "cu_rp_encoder::Encoder",
            params: {
                pin_clt: 17,
                pin_dat: 18,
            },
        ),
    ]

The pin_clt is the pin for the clock signal and the pin_dat is the pin for the direction signal.

When you connect this driver to the rest of the system you need to use the cu_rp_encoder::EncoderMsg message type.

    cnx: [
        (src: "src",  dst: "dst",   msg: "cu_rp_encoder::EncoderMsg"),
    ],

It has been tested with a Hall effect encoder like this one:

The encoder
Commit count: 741

cargo fmt