motor

package
v0.0.0-...-76dc376 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2015 License: Apache-2.0 Imports: 4 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Motor

type Motor struct {
	// contains filtered or unexported fields
}

Motor is a driver for a stepper motor

func New

func New(stepPin, stepPwmID, dirPin, sleepPin byte) *Motor

New creates a new Motor for a stepper motor drived with GPIOs

func (Motor) Disable

func (m Motor) Disable() error

Disable disables the torque

func (Motor) Enable

func (m Motor) Enable() error

Enable enables the torque

func (Motor) Move

func (m Motor) Move(clockwise bool, stepsBySecond uint32, duration time.Duration) error

Move makes the motor rotate in the given direction at the specified speed for a given duration -- make sure to Enable() the motor first

func (Motor) Unexport

func (m Motor) Unexport()

Unexport unexports the GPIO used by to drive the motor

Jump to

Keyboard shortcuts

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