hybridgroup.gobot/platforms/beaglebone/doc.go

48 lines
1.0 KiB
Go
Raw Normal View History

2014-10-16 23:59:23 +08:00
/*
Package beaglebone provides the Gobot adaptor for the Beaglebone Black/Green, as well as a
separate Adaptor for the PocketBeagle.
2014-10-16 23:59:23 +08:00
Installing:
Please refer to the main [README.md](https://github.com/hybridgroup/gobot/blob/release/README.md)
2014-10-16 23:59:23 +08:00
Example:
package main
import (
"time"
"gobot.io/x/gobot/v2"
"gobot.io/x/gobot/v2/drivers/gpio"
"gobot.io/x/gobot/v2/platforms/beaglebone"
2014-10-16 23:59:23 +08:00
)
func main() {
beagleboneAdaptor := beaglebone.NewAdaptor()
led := gpio.NewLedDriver(beagleboneAdaptor, "P9_12")
2014-10-16 23:59:23 +08:00
work := func() {
gobot.Every(1*time.Second, func() {
if err := led.Toggle(); err != nil {
fmt.Println(err)
}
2014-10-16 23:59:23 +08:00
})
}
robot := gobot.NewRobot("blinkBot",
[]gobot.Connection{beagleboneAdaptor},
[]gobot.Device{led},
work,
)
if err := robot.Start(); err != nil {
panic(err)
}
2014-10-16 23:59:23 +08:00
}
For more information refer to the beaglebone README:
https://github.com/hybridgroup/gobot/blob/release/platforms/beaglebone/README.md
2014-10-16 23:59:23 +08:00
*/
package beaglebone // import "gobot.io/x/gobot/v2/platforms/beaglebone"