Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MegaPiAdaptor ¶
type MegaPiAdaptor struct {
// contains filtered or unexported fields
}
MegaPiAdaptor is the Gobot adaptor for the MakeBlock MegaPi board
func NewMegaPiAdaptor ¶
func NewMegaPiAdaptor(name string, device string) *MegaPiAdaptor
NewMegaPiAdaptor returns a new MegaPiAdaptor with specified name and specified serial port used to talk to the MegaPi with a baud rate of 115200
func (*MegaPiAdaptor) Connect ¶
func (megaPi *MegaPiAdaptor) Connect() (errs []error)
Connect starts a connection to the board
func (*MegaPiAdaptor) Finalize ¶
func (megaPi *MegaPiAdaptor) Finalize() (errs []error)
Finalize terminates the connection to the board
func (*MegaPiAdaptor) Name ¶
func (megaPi *MegaPiAdaptor) Name() string
Name returns the name of this adaptor
type MotorDriver ¶
type MotorDriver struct {
// contains filtered or unexported fields
}
MotorDriver represents a motor
func NewMotorDriver ¶
func NewMotorDriver(megaPi *MegaPiAdaptor, name string, port byte) *MotorDriver
NewMotorDriver creates a new MotorDriver using the provided name, and at the given port
func (*MotorDriver) Connection ¶
func (m *MotorDriver) Connection() gobot.Connection
Connection returns the Connection associated with the Driver
func (*MotorDriver) Halt ¶
func (m *MotorDriver) Halt() []error
Halt terminates the Driver interface
func (*MotorDriver) Speed ¶
func (m *MotorDriver) Speed(speed int16) error
Speed sets the motors speed to the specified value
func (*MotorDriver) Start ¶
func (m *MotorDriver) Start() []error
Start implements the Driver interface