mc

package
v0.0.0-...-418de2e Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EncoderLeftFront  = C.RegisterEncoderLeftFront
	EncoderLeftBack   = C.RegisterEncoderLeftBack
	EncoderRightFront = C.RegisterEncoderRightFront
	EncoderRightBack  = C.RegisterEncoderRightBack
)

Encoder registers for ReadEncoder function

View Source
const Address = C.I2CAddress

Address of BotBoarduino on i2c bus

View Source
const MaxSpeed = 90

MaxSpeed is a max speed (positive or negative) for motors

Variables

This section is empty.

Functions

This section is empty.

Types

type MC

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

MC is a control interface for Motor Controller part of the project

func NewMC

func NewMC(bus i2c.Bus, addr byte) *MC

NewMC creates a new instance of BotBoarduino to use

func (*MC) Brake

func (mc *MC) Brake(brake bool) error

Brake enables or disables an algorithm which tries to keep motor encoder deltas to zero. It basically means that whenever an encoder detects wheel movement, power is applied to the motors to revert to the previous encoder position. This is a somewhat similar to a car brake.

func (*MC) Left

func (mc *MC) Left(speed int8) error

Left motor start, speed in rage -MaxSpeed .. MaxSpeed

func (*MC) ReadEncoder

func (mc *MC) ReadEncoder(encoder byte) (value int32, e error)

ReadEncoder reads encoder value, in absolute steps, Encoder{Left,Right}{Front,Back}

func (*MC) Right

func (mc *MC) Right(speed int8) error

Right motor start, speed in rage -MaxSpeed .. MaxSpeed

func (*MC) Sleep

func (mc *MC) Sleep() error

Sleep reduces power usage of the module (and some hardware)

func (*MC) Wake

func (mc *MC) Wake() error

Wake is necessary to re-enable hardware disabled by Sleep()

Jump to

Keyboard shortcuts

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