2014-10-16 23:59:23 +08:00
|
|
|
/*
|
2014-10-29 05:52:59 +08:00
|
|
|
Package beaglebone provides the Gobot adaptor for the Beaglebone Black.
|
2014-10-16 23:59:23 +08:00
|
|
|
|
|
|
|
Installing:
|
|
|
|
|
2016-12-21 17:50:56 +08:00
|
|
|
go get gobot.io/x/gobot/platforms/beaglebone
|
2014-10-16 23:59:23 +08:00
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
2016-12-08 20:24:03 +08:00
|
|
|
"gobot.io/x/gobot"
|
|
|
|
"gobot.io/x/gobot/drivers/gpio"
|
|
|
|
"gobot.io/x/gobot/platforms/beaglebone"
|
2014-10-16 23:59:23 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2016-09-25 20:12:52 +08:00
|
|
|
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() {
|
|
|
|
led.Toggle()
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
robot := gobot.NewRobot("blinkBot",
|
|
|
|
[]gobot.Connection{beagleboneAdaptor},
|
|
|
|
[]gobot.Device{led},
|
|
|
|
work,
|
|
|
|
)
|
|
|
|
|
2016-10-19 03:37:10 +08:00
|
|
|
robot.Start()
|
2014-10-16 23:59:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
For more information refer to the beaglebone README:
|
2016-12-21 17:50:56 +08:00
|
|
|
https://github.com/hybridgroup/gobot/blob/master/platforms/beaglebone/README.md
|
2014-10-16 23:59:23 +08:00
|
|
|
*/
|
2016-12-08 20:24:03 +08:00
|
|
|
package beaglebone // import "gobot.io/x/gobot/platforms/beaglebone"
|