robot

package
v0.0.0-...-268f5dc Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: BlueOak-1.0.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoRobot

type GoRobot interface {
	On(name string, f func(s interface{})) (err error)
	Publish(name string, data interface{})
	Stop() error
}

GoRobot is the interface for the gobot.Robot

type Robot

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

Robot is a gobot wrapper

func Create

func Create(gpioPin string, config *ServoConfig) (*Robot, error)

Create creates a new robot from gobot

func New

func New(robo GoRobot, controller ServoController, config *ServoConfig) *Robot

New returns a new robot

func (*Robot) Init

func (r *Robot) Init() error

Init moves to robot to the none position

func (*Robot) Publish

func (r *Robot) Publish(name string, data interface{})

Publish publishes a message to the robot

func (*Robot) Register

func (r *Robot) Register() error

Register registers the robot to listen for the move event

func (*Robot) Stop

func (r *Robot) Stop() error

Stop stops the robot (closes connection and device)

type ServoConfig

type ServoConfig struct {
	AngleNone    uint8 // when the build is not running
	AngleRunning uint8 // when the build is running
	AngleSuccess uint8 // when the build is successful
	AngleFailure uint8 // when the build is failed
}

ServoConfig is the configuration for the servo

type ServoController

type ServoController interface {
	Move(angle uint8) (err error)
}

Jump to

Keyboard shortcuts

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