Documentation ¶
Overview ¶
Package incremental implements an incremental encoder
Index ¶
- func NewIncrementalEncoder(ctx context.Context, deps registry.Dependencies, cfg config.Component, ...) (encoder.Encoder, error)
- type AttrConfig
- type Encoder
- func (e *Encoder) Close() error
- func (e *Encoder) GetPosition(ctx context.Context, positionType *encoder.PositionType, ...) (float64, encoder.PositionType, error)
- func (e *Encoder) GetProperties(ctx context.Context, extra map[string]interface{}) (map[encoder.Feature]bool, error)
- func (e *Encoder) RawPosition() int64
- func (e *Encoder) ResetPosition(ctx context.Context, extra map[string]interface{}) error
- func (e *Encoder) Start(ctx context.Context)
- type Pins
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AttrConfig ¶
AttrConfig describes the configuration of a quadrature encoder.
type Encoder ¶
type Encoder struct {
A, B board.DigitalInterrupt
CancelCtx context.Context
generic.Unimplemented
// contains filtered or unexported fields
}
Encoder keeps track of a motor position using a rotary incremental encoder.
func (*Encoder) GetPosition ¶
func (e *Encoder) GetPosition( ctx context.Context, positionType *encoder.PositionType, extra map[string]interface{}, ) (float64, encoder.PositionType, error)
GetPosition returns the current position in terms of ticks or degrees, and whether it is a relative or absolute position.
func (*Encoder) GetProperties ¶
func (e *Encoder) GetProperties(ctx context.Context, extra map[string]interface{}) (map[encoder.Feature]bool, error)
GetProperties returns a list of all the position types that are supported by a given encoder.
func (*Encoder) RawPosition ¶
RawPosition returns the raw position of the encoder.
func (*Encoder) ResetPosition ¶
ResetPosition sets the current position of the motor (adjusted by a given offset) to be its new zero position..
Click to show internal directories.
Click to hide internal directories.