2014-10-16 23:59:23 +08:00
|
|
|
/*
|
2017-12-19 20:42:49 +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:
|
|
|
|
|
2023-06-05 00:36:55 +08:00
|
|
|
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"
|
|
|
|
|
2023-05-20 20:25:21 +08:00
|
|
|
"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() {
|
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() {
|
2024-02-11 22:34:50 +08:00
|
|
|
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,
|
|
|
|
)
|
|
|
|
|
2024-02-11 22:34:50 +08:00
|
|
|
if err := robot.Start(); err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
2014-10-16 23:59:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
For more information refer to the beaglebone README:
|
2024-02-13 22:58:31 +08:00
|
|
|
https://github.com/hybridgroup/gobot/blob/release/platforms/beaglebone/README.md
|
2014-10-16 23:59:23 +08:00
|
|
|
*/
|
2023-05-20 20:25:21 +08:00
|
|
|
package beaglebone // import "gobot.io/x/gobot/v2/platforms/beaglebone"
|