Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LED ¶
type LED struct {
// contains filtered or unexported fields
}
LED is the led service object
func NewLED ¶
NewLED creates a new gopigo LED object for manipulating the bots lights
Example (Debug) ¶
package main import ( "time" "github.com/open-farms/bot/pkg/gopigo" "gobot.io/x/gobot" "gobot.io/x/gobot/platforms/dexter/gopigo3" "gobot.io/x/gobot/platforms/raspi" ) func main() { rpi := raspi.NewAdaptor() driver := gopigo3.NewDriver(rpi) done := make(chan bool, 1) gobot.After(5*time.Second, func() { done <- true }) work := func() { led := gopigo.NewLED(driver, gopigo.WithDebug(), ) err := led.Blink(1*time.Second, done) if err != nil { panic(err) } } robot := gobot.NewRobot("gopigo", []gobot.Connection{rpi}, []gobot.Device{driver}, work, ) robot.Start() }
Output:
func (*LED) ApplyColor ¶
ApplyColor sets the color of the gopigo's LED
type Motor ¶
type Motor struct {
// contains filtered or unexported fields
}
func NewMotor ¶
func NewMotor(driver *gopigo3.Driver, options ...MotorOption) *Motor
NewMotor creates a new gopigo Motor
func (*Motor) WithDebug ¶
func (m *Motor) WithDebug() MotorOption
type MotorOption ¶
type MotorOption func(*Motor)
Click to show internal directories.
Click to hide internal directories.