l293x

package
v0.15.3 Latest Latest
Warning

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

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

Documentation

Overview

Package l293x provides a driver to the L293/L293D H-bridge chip typically used to control DC motors.

Datasheet: https://www.ti.com/lit/ds/symlink/l293d.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. a1 and a2 are the directional pins. en is the pin turns the motor on/off.

func New

func New(direction1, direction2, enablePin 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. a1 and a2 are the directional GPIO pins. en is the PWM pin that controls the motor speed.

func NewWithSpeed

func NewWithSpeed(direction1, direction2 machine.Pin, speedPin machine.PWM) PWMDevice

NewWithSpeed returns a new PWMMotor driver that uses a PWM pin to control 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