easystepper

package
v0.0.0-...-3bb5b45 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2019 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package easystepper provides a simple driver to rotate a 4-wire stepper motor.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

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

Device holds the pins and the delay between steps

func New

func New(pin1, pin2, pin3, pin4 machine.Pin, steps int32, rpm int32) Device

New returns a new easystepper driver given 4 pins numbers (not pin object), number of steps and rpm

func (*Device) Configure

func (d *Device) Configure()

Configure configures the pins of the Device

func (*Device) Move

func (d *Device) Move(steps int32)

Move rotates the motor the number of given steps (negative steps will rotate it the opposite direction)

func (*Device) Off

func (d *Device) Off()

Off turns off all motor pins

type DualDevice

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

DualDevice holds information for controlling 2 motors

func NewDual

func NewDual(pin1, pin2, pin3, pin4, pin5, pin6, pin7, pin8 machine.Pin, steps int32, rpm int32) DualDevice

NewDual returns a new dual easystepper driver given 8 pins numbers (not pin object), number of steps and rpm

func (*DualDevice) Configure

func (d *DualDevice) Configure()

Configure configures the pins of the DualDevice

func (*DualDevice) Move

func (d *DualDevice) Move(stepsA, stepsB int32)

Move rotates the motors the number of given steps (negative steps will rotate it the opposite direction)

func (*DualDevice) Off

func (d *DualDevice) Off()

Off turns off all motor pins

Jump to

Keyboard shortcuts

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