a4988

package module
v0.0.0-...-19c8ab8 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2019 License: MIT Imports: 2 Imported by: 0

README

go-a4988

Go Report Card

Use an A4988 stepper motor driver on a Raspberry Pi with Go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

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

Driver contains pin mappings

func Init

func Init(dir uint8, step uint8, ms1 uint8, ms2 uint8, ms3 uint8, enable uint8) (driver Driver, err error)

Init returns a new stepper driver

func (*Driver) Close

func (driver *Driver) Close()

Close rpio

func (*Driver) Direction

func (driver *Driver) Direction(dir bool)

Direction true/false alters the stepper's rotational direction

func (*Driver) Disable

func (driver *Driver) Disable()

Disable the stepper driver

func (*Driver) Enable

func (driver *Driver) Enable()

Enable the stepper driver

func (*Driver) StepSize

func (driver *Driver) StepSize(ss int)

StepSize sets the stepper's microstep increment (0 = Full, 1 = Half, 2 = Quarter, 3 = Eighth, 4 = Sixteenth)

func (*Driver) Turn

func (driver *Driver) Turn(steps int)

Turn the stepper n steps

Jump to

Keyboard shortcuts

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