Documentation ¶
Overview ¶
Package beaglebone provides the Gobot adaptor for the Beaglebone Black/Green, as well as a separate Adaptor for the PocketBeagle.
Installing:
go get gobot.io/x/gobot/platforms/beaglebone
Example:
package main import ( "time" "gobot.io/x/gobot" "gobot.io/x/gobot/drivers/gpio" "gobot.io/x/gobot/platforms/beaglebone" ) func main() { beagleboneAdaptor := beaglebone.NewAdaptor() led := gpio.NewLedDriver(beagleboneAdaptor, "P9_12") work := func() { gobot.Every(1*time.Second, func() { led.Toggle() }) } robot := gobot.NewRobot("blinkBot", []gobot.Connection{beagleboneAdaptor}, []gobot.Device{led}, work, ) robot.Start() }
For more information refer to the beaglebone README: https://github.com/hybridgroup/gobot/blob/master/platforms/beaglebone/README.md
Index ¶
- type Adaptor
- func (b *Adaptor) AnalogRead(pin string) (val int, err error)
- func (b *Adaptor) Connect() error
- func (b *Adaptor) DigitalPin(pin string, dir string) (sysfsPin sysfs.DigitalPinner, err error)
- func (b *Adaptor) DigitalRead(pin string) (val int, err error)
- func (b *Adaptor) DigitalWrite(pin string, val byte) (err error)
- func (b *Adaptor) Finalize() (err error)
- func (b *Adaptor) GetConnection(address int, bus int) (connection i2c.Connection, err error)
- func (b *Adaptor) GetDefaultBus() int
- func (b *Adaptor) GetSpiConnection(busNum, mode int, maxSpeed int64) (connection spi.Connection, err error)
- func (b *Adaptor) GetSpiDefaultBus() int
- func (b *Adaptor) GetSpiDefaultMaxSpeed() int64
- func (b *Adaptor) GetSpiDefaultMode() int
- func (b *Adaptor) Name() string
- func (b *Adaptor) PWMPin(pin string) (sysfsPin sysfs.PWMPinner, err error)
- func (b *Adaptor) PwmWrite(pin string, val byte) (err error)
- func (b *Adaptor) ServoWrite(pin string, angle byte) (err error)
- func (b *Adaptor) SetName(n string)
- type PocketBeagleAdaptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adaptor ¶ added in v1.0.0
type Adaptor struct {
// contains filtered or unexported fields
}
Adaptor is the gobot.Adaptor representation for the Beaglebone Black/Green
func NewAdaptor ¶ added in v1.0.0
func NewAdaptor() *Adaptor
NewAdaptor returns a new Beaglebone Black/Green Adaptor
func (*Adaptor) AnalogRead ¶ added in v1.0.0
AnalogRead returns an analog value from specified pin
func (*Adaptor) DigitalPin ¶ added in v1.5.0
DigitalPin retrieves digital pin value by name
func (*Adaptor) DigitalRead ¶ added in v1.0.0
DigitalRead returns a digital value from specified pin
func (*Adaptor) DigitalWrite ¶ added in v1.0.0
DigitalWrite writes a digital value to specified pin. valid usr pin values are usr0, usr1, usr2 and usr3
func (*Adaptor) Finalize ¶ added in v1.0.0
Finalize releases all i2c devices and exported analog, digital, pwm pins.
func (*Adaptor) GetConnection ¶ added in v1.2.0
GetConnection returns a connection to a device on a specified bus. Valid bus number is either 0 or 2 which corresponds to /dev/i2c-0 or /dev/i2c-2.
func (*Adaptor) GetDefaultBus ¶ added in v1.2.0
GetDefaultBus returns the default i2c bus for this platform
func (*Adaptor) GetSpiConnection ¶ added in v1.8.0
func (b *Adaptor) GetSpiConnection(busNum, mode int, maxSpeed int64) (connection spi.Connection, err error)
GetSpiConnection returns an spi connection to a device on a specified bus. Valid bus number is [0..1] which corresponds to /dev/spidev0.0 through /dev/spidev0.1.
func (*Adaptor) GetSpiDefaultBus ¶ added in v1.8.0
GetSpiDefaultBus returns the default spi bus for this platform.
func (*Adaptor) GetSpiDefaultMaxSpeed ¶ added in v1.8.0
GetSpiDefaultMaxSpeed returns the default spi bus for this platform.
func (*Adaptor) GetSpiDefaultMode ¶ added in v1.8.0
GetSpiDefaultMode returns the default spi mode for this platform.
func (*Adaptor) ServoWrite ¶ added in v1.0.0
ServoWrite writes a servo signal to the specified pin
type PocketBeagleAdaptor ¶ added in v1.8.0
type PocketBeagleAdaptor struct {
*Adaptor
}
PocketBeagleAdaptor is the Gobot Adaptor for the PocketBeagle For more information check out:
http://beagleboard.org/pocket
func NewPocketBeagleAdaptor ¶ added in v1.8.0
func NewPocketBeagleAdaptor() *PocketBeagleAdaptor
NewPocketBeagleAdaptor creates a new Adaptor for the PocketBeagle