Back to godoc.org

Package servo

v0.0.0-...-d3d8c0c
Latest Go to latest

The latest major version is .

Published: May 8, 2017 | License: MIT | Module: github.com/kidoman/embd

Overview

Package servo allows control of servos using a PWM controller.

Index

Constants

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 {
	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.

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