l9110x

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2020 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package l9110x provides a driver to the L9110/L9110S H-bridge chip typically used to control DC motors.

Datasheet: https://www.elecrow.com/download/datasheet-l9110.pdf

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 is a motor without speed control. ia and ib are the directional pins.

func New

func New(direction1, direction2 machine.Pin) Device

New returns a new Motor driver for GPIO-only operation.

func (*Device) Backward

func (d *Device) Backward()

Backward turns motor on in backward direction.

func (*Device) Configure

func (d *Device) Configure()

Configure configures the Device.

func (*Device) Forward

func (d *Device) Forward()

Forward turns motor on in forward direction.

func (*Device) Stop

func (d *Device) Stop()

Stop turns motor off.

type PWMDevice

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

PWMDevice is a motor with speed control. ia and ib are the directional/speed PWM pins.

func NewWithSpeed

func NewWithSpeed(direction1, direction2 machine.PWM) PWMDevice

NewWithSpeed returns a new PWMMotor driver that uses 2 PWM pins to control both direction and speed.

func (*PWMDevice) Backward

func (d *PWMDevice) Backward(speed uint16)

Backward turns motor on in backward direction at specific speed.

func (*PWMDevice) Configure

func (d *PWMDevice) Configure()

Configure configures the PWMDevice.

func (*PWMDevice) Forward

func (d *PWMDevice) Forward(speed uint16)

Forward turns motor on in forward direction at specific speed.

func (*PWMDevice) Stop

func (d *PWMDevice) Stop()

Stop turns motor off.

Jump to

Keyboard shortcuts

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