gobot: gobot.io/x/gobot/platforms/beaglebone Index | Files

package beaglebone

import "gobot.io/x/gobot/platforms/beaglebone"

Package beaglebone provides the Gobot adaptor for the Beaglebone Black/Green, as well as a separate Adaptor for the PocketBeagle.


go get gobot.io/x/gobot/platforms/beaglebone


package main

import (


func main() {
	beagleboneAdaptor := beaglebone.NewAdaptor()
	led := gpio.NewLedDriver(beagleboneAdaptor, "P9_12")

	work := func() {
		gobot.Every(1*time.Second, func() {

	robot := gobot.NewRobot("blinkBot",


For more information refer to the beaglebone README: https://github.com/hybridgroup/gobot/blob/master/platforms/beaglebone/README.md


Package Files

beaglebone_adaptor.go black_pins.go doc.go pocketbeagle_adaptor.go pocketbeagle_pins.go

type Adaptor Uses

type Adaptor struct {
    // contains filtered or unexported fields

Adaptor is the gobot.Adaptor representation for the Beaglebone Black/Green

func NewAdaptor Uses

func NewAdaptor() *Adaptor

NewAdaptor returns a new Beaglebone Black/Green Adaptor

func (*Adaptor) AnalogRead Uses

func (b *Adaptor) AnalogRead(pin string) (val int, err error)

AnalogRead returns an analog value from specified pin

func (*Adaptor) Connect Uses

func (b *Adaptor) Connect() error

Connect initializes the pwm and analog dts.

func (*Adaptor) DigitalPin Uses

func (b *Adaptor) DigitalPin(pin string, dir string) (sysfsPin sysfs.DigitalPinner, err error)

DigitalPin retrieves digital pin value by name

func (*Adaptor) DigitalRead Uses

func (b *Adaptor) DigitalRead(pin string) (val int, err error)

DigitalRead returns a digital value from specified pin

func (*Adaptor) DigitalWrite Uses

func (b *Adaptor) DigitalWrite(pin string, val byte) (err error)

DigitalWrite writes a digital value to specified pin. valid usr pin values are usr0, usr1, usr2 and usr3

func (*Adaptor) Finalize Uses

func (b *Adaptor) Finalize() (err error)

Finalize releases all i2c devices and exported analog, digital, pwm pins.

func (*Adaptor) GetConnection Uses

func (b *Adaptor) GetConnection(address int, bus int) (connection i2c.Connection, err error)

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 Uses

func (b *Adaptor) GetDefaultBus() int

GetDefaultBus returns the default i2c bus for this platform

func (*Adaptor) GetSpiConnection Uses

func (b *Adaptor) GetSpiConnection(busNum, chipNum, mode, bits 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) GetSpiDefaultBits Uses

func (b *Adaptor) GetSpiDefaultBits() int

GetSpiDefaultBits returns the default spi number of bits for this platform.

func (*Adaptor) GetSpiDefaultBus Uses

func (b *Adaptor) GetSpiDefaultBus() int

GetSpiDefaultBus returns the default spi bus for this platform.

func (*Adaptor) GetSpiDefaultChip Uses

func (b *Adaptor) GetSpiDefaultChip() int

GetSpiDefaultChip returns the default spi chip for this platform.

func (*Adaptor) GetSpiDefaultMaxSpeed Uses

func (b *Adaptor) GetSpiDefaultMaxSpeed() int64

GetSpiDefaultMaxSpeed returns the default spi bus for this platform.

func (*Adaptor) GetSpiDefaultMode Uses

func (b *Adaptor) GetSpiDefaultMode() int

GetSpiDefaultMode returns the default spi mode for this platform.

func (*Adaptor) Name Uses

func (b *Adaptor) Name() string

Name returns the Adaptor name

func (*Adaptor) PWMPin Uses

func (b *Adaptor) PWMPin(pin string) (sysfsPin sysfs.PWMPinner, err error)

PWMPin returns matched pwmPin for specified pin number

func (*Adaptor) PwmWrite Uses

func (b *Adaptor) PwmWrite(pin string, val byte) (err error)

PwmWrite writes the 0-254 value to the specified pin

func (*Adaptor) ServoWrite Uses

func (b *Adaptor) ServoWrite(pin string, angle byte) (err error)

ServoWrite writes a servo signal to the specified pin

func (*Adaptor) SetName Uses

func (b *Adaptor) SetName(n string)

SetName sets the Adaptor name

type PocketBeagleAdaptor Uses

type PocketBeagleAdaptor struct {

PocketBeagleAdaptor is the Gobot Adaptor for the PocketBeagle For more information check out:


func NewPocketBeagleAdaptor Uses

func NewPocketBeagleAdaptor() *PocketBeagleAdaptor

NewPocketBeagleAdaptor creates a new Adaptor for the PocketBeagle

Package beaglebone imports 12 packages (graph). Updated 2018-04-20. Refresh now. Tools for package owners.