components

package
v0.0.0-...-f592e1d Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServoRangeDef    int     = 180
	ServoMinPulseDef float32 = 500.0
	ServoMaxPulseDef float32 = 2500.0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Servo

type Servo struct {
	// contains filtered or unexported fields
}

Servo structure

func (*Servo) Angle

func (servo *Servo) Angle(angle int) (err error)

Angle in degrees. Must be in the range `0` to `Range`.

func (*Servo) Fraction

func (servo *Servo) Fraction(fraction float32) (err error)

Fraction as pulse width expressed between 0.0 `MinPulse` and 1.0 `MaxPulse`. For conventional servos, corresponds to the servo position as a fraction of the actuation range.

func (*Servo) Init

func (servo *Servo) Init(pca *pca9685.PCA9685, servoChannel int, serverOptions *ServoOptions) *Servo

ServoNew creates a new servo driver

func (*Servo) Reset

func (servo *Servo) Reset() (err error)

Reset channel

type ServoOptions

type ServoOptions struct {
	ActuationRange int // actuation range
	MinPulse       float32
	MaxPulse       float32
}

ServoOptions for servo

Jump to

Keyboard shortcuts

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