arduino

package
v0.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2022 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Overview

Package arduino implements the arduino board and some peripherals.

Index

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 Encoder added in v0.0.7

type Encoder struct {
	A, B string

	generic.Unimplemented
	// contains filtered or unexported fields
}

Encoder keeps track of an arduino motor position.

func NewEncoder added in v0.0.7

func NewEncoder(ctx context.Context, deps registry.Dependencies, config config.Component, logger golog.Logger) (*Encoder, error)

NewEncoder creates a new HallEncoder.

func (*Encoder) GetTicksCount added in v0.0.7

func (e *Encoder) GetTicksCount(ctx context.Context, extra map[string]interface{}) (int64, error)

GetTicksCount returns number of ticks since last zeroing.

func (*Encoder) Reset added in v0.0.7

func (e *Encoder) Reset(ctx context.Context, offset int64, extra map[string]interface{}) error

Reset sets the current position of the motor (adjusted by a given offset) to be its new zero position.

type EncoderConfig added in v0.0.7

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 added in v0.0.7

type EncoderPins struct {
	A string `json:"a"`
	B string `json:"b"`
}

EncoderPins defines the format the pin config should be in for Encoder.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL