servo

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package servo allows control of servos using a PWM controller.

Index

Constants

View Source
const (
	// DefaultFreq represents the default (preferred) freq of a PWM doing servo duties.
	DefaultFreq = 50
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PWM

type PWM interface {
	SetMicroseconds(us int) error
}

A PWM interface implements access to a pwm controller.

type Servo

type Servo struct {
	PWM PWM

	Minus, Maxus int
}

func New

func New(pwm PWM) *Servo

New creates a new Servo interface.

func (*Servo) SetAngle

func (s *Servo) SetAngle(angle int) error

SetAngle sets the servo angle.

Jump to

Keyboard shortcuts

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