gobot: gobot.io/x/gobot/platforms/megapi Index | Files

package megapi

import "gobot.io/x/gobot/platforms/megapi"

Package megapi provides the Gobot adaptor for MegaPi.

For more information refer to the README: https://github.com/hybridgroup/gobot/blob/master/platforms/megapi/README.md

Index

Package Files

doc.go megapi_adaptor.go motor_driver.go

type Adaptor Uses

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

Adaptor is the Gobot adaptor for the MakeBlock MegaPi board

func NewAdaptor Uses

func NewAdaptor(device string) *Adaptor

NewAdaptor returns a new MegaPi Adaptor with specified serial port used to talk to the MegaPi with a baud rate of 115200

func (*Adaptor) Connect Uses

func (megaPi *Adaptor) Connect() error

Connect starts a connection to the board

func (*Adaptor) Finalize Uses

func (megaPi *Adaptor) Finalize() error

Finalize terminates the connection to the board

func (*Adaptor) Name Uses

func (megaPi *Adaptor) Name() string

Name returns the name of this adaptor

func (*Adaptor) SetName Uses

func (megaPi *Adaptor) SetName(n string)

SetName sets the name of this adaptor

type MotorDriver Uses

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

MotorDriver represents a motor

func NewMotorDriver Uses

func NewMotorDriver(megaPi *Adaptor, port byte) *MotorDriver

NewMotorDriver creates a new MotorDriver at the given port

func (*MotorDriver) Connection Uses

func (m *MotorDriver) Connection() gobot.Connection

Connection returns the Connection associated with the Driver

func (*MotorDriver) Halt Uses

func (m *MotorDriver) Halt() error

Halt terminates the Driver interface

func (*MotorDriver) Name Uses

func (m *MotorDriver) Name() string

Name returns the name of this motor

func (*MotorDriver) SetName Uses

func (m *MotorDriver) SetName(n string)

SetName sets the name of this motor

func (*MotorDriver) Speed Uses

func (m *MotorDriver) Speed(speed int16) error

Speed sets the motors speed to the specified value

func (*MotorDriver) Start Uses

func (m *MotorDriver) Start() error

Start implements the Driver interface

Package megapi imports 7 packages (graph). Updated 2017-06-23. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).