Back to

Package servo

Latest Go to latest

The latest major version is .

Published: May 8, 2017 | License: MIT | Module:


Package servo allows control of servos using a PWM controller.



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

type PWM

type PWM interface {
	SetMicroseconds(us int) error

A PWM interface implements access to a pwm controller.

type Servo

type Servo struct {

	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.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier