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
doc.go megapi_adaptor.go motor_driver.go
type Adaptor struct {
// contains filtered or unexported fields
}
Adaptor is the Gobot adaptor for the MakeBlock MegaPi board
NewAdaptor returns a new MegaPi Adaptor with specified serial port used to talk to the MegaPi with a baud rate of 115200
Connect starts a connection to the board
Finalize terminates the connection to the board
Name returns the name of this adaptor
SetName sets the name of this adaptor
type MotorDriver struct {
// contains filtered or unexported fields
}
MotorDriver represents a motor
func NewMotorDriver(megaPi *Adaptor, port byte) *MotorDriver
NewMotorDriver creates a new MotorDriver at the given port
func (m *MotorDriver) Connection() gobot.Connection
Connection returns the Connection associated with the Driver
func (m *MotorDriver) Halt() error
Halt terminates the Driver interface
func (m *MotorDriver) Name() string
Name returns the name of this motor
func (m *MotorDriver) SetName(n string)
SetName sets the name of this motor
func (m *MotorDriver) Speed(speed int16) error
Speed sets the motors speed to the specified value
func (m *MotorDriver) Start() error
Start implements the Driver interface
Package megapi imports 7 packages (graph) and is imported by 1 packages. Updated 2020-12-06. Refresh now. Tools for package owners.