embd: github.com/kidoman/embd/motion/servo Index | Files

package servo

import "github.com/kidoman/embd/motion/servo"

Package servo allows control of servos using a PWM controller.


Package Files



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

type PWM Uses

type PWM interface {
    SetMicroseconds(us int) error

A PWM interface implements access to a pwm controller.

type Servo Uses

type Servo struct {

    Minus, Maxus int

func New Uses

func New(pwm PWM) *Servo

New creates a new Servo interface.

func (*Servo) SetAngle Uses

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

SetAngle sets the servo angle.

Package servo imports 2 packages (graph) and is imported by 2 packages. Updated 2016-07-16. Refresh now. Tools for package owners.