Struct wpilib::encoder::Encoder

source ·
pub struct Encoder { /* private fields */ }
Expand description

An encoder.

Uses quadrature on two separate channels to read the distance and direction travelled by a shaft. All integration is done by the FPGA.

Implementations

Create a new encoder given two channels and an encoding type, returning an error if initialization fails.

Get the FPGA index of this encoder.

Get the current value read by this encoder, with any scaling factors applied.

Get the raw value of this encoder, without any scaling factors.

Get the current scaling factor for this encoder.

Get the current (estimated) speed this encoder is travelling at.

Set the minimum rate that this encoder must be moving at to be considered “moving”.

Reset the count of this encoder.

Trait Implementations

Formats the value using the given formatter. Read more
Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.