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.

Source Files