Documentation ¶
Overview ¶
Package arduino implements the arduino board and some peripherals.
Index ¶
- Constants
- type Config
- type Encoder
- 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) ResetPosition(ctx context.Context, extra map[string]interface{}) error
- type EncoderConfig
- type EncoderPins
Constants ¶
View Source
const SetPowerZeroThreshold = .0001
SetPowerZeroThreshold represents a power below which value attempting to run the motor simply stops it.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Analogs []board.AnalogConfig `json:"analogs,omitempty"` SerialPath string `json:"serial_path"` Attributes config.AttributeMap `json:"attributes,omitempty"` }
A Config describes the configuration of a board and all of its connected parts.
type Encoder ¶
type Encoder struct {
A, B string
generic.Unimplemented
// contains filtered or unexported fields
}
Encoder keeps track of an arduino motor position.
func NewEncoder ¶
func NewEncoder(ctx context.Context, deps registry.Dependencies, config config.Component, logger golog.Logger) (*Encoder, error)
NewEncoder creates a new incremental Encoder.
func (*Encoder) GetPosition ¶ added in v0.2.34
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.
type EncoderConfig ¶
type EncoderConfig struct { Pins EncoderPins `json:"pins"` BoardName string `json:"board"` MotorName string `json:"motor_name"` }
EncoderConfig describes the config of an arduino Encoder.
type EncoderPins ¶
EncoderPins defines the format the pin config should be in for Encoder.
Click to show internal directories.
Click to hide internal directories.