beaglebone

package
v0.0.0-...-d941a39 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2014 License: Apache-2.0, Apache-2.0 Imports: 8 Imported by: 0

README

Beaglebone

This package provides the Gobot adaptor for the Beaglebone Black

Getting Started

Installing

go get github.com/hybridgroup/gobot && go install github.com/hybridgroup/platforms/beaglebone

Cross compiling for the Beaglebone Black

You must first configure your Go environment for arm linux cross compiling

$ cd $GOROOT/src
$ GOOS=linux GOARCH=arm ./make.bash --no-clean

Then compile your Gobot program with

$ GOARM=7 GOARCH=arm GOOS=linux go build examples/beaglebone_blink.go

If you are running the official Angstrom or Debian linux through the usb->ethernet connection, you can simply upload your program and execute it with

$ scp beaglebone_blink root@192.168.7.2:/home/root/
$ ssh -t root@192.168.7.2 "./beaglebone_blink"

Example

package main

import (
        "github.com/hybridgroup/gobot"
        "github.com/hybridgroup/gobot/platforms/beaglebone"
        "github.com/hybridgroup/gobot/platforms/gpio"
        "time"
)

func main() {
        gbot := gobot.NewGobot()

        adaptor := beaglebone.NewBeagleboneAdaptor("beaglebone")
        led := gpio.NewLedDriver(adaptor, "led", "P9_12")

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

        gbot.Robots = append(gbot.Robots,
                gobot.NewRobot("blinkBot", []gobot.Connection{adaptor}, []gobot.Device{led}, work))
        gbot.Start()
}

Documentation

Index

Constants

View Source
const GPIODirectionRead = "in"
View Source
const GPIODirectionWrite = "out"
View Source
const GPIOPath = "/sys/class/gpio"
View Source
const HIGH = 1
View Source
const I2CLocation = "/dev/i2c-1"
View Source
const I2CSlave = 0x0703
View Source
const LOW = 0
View Source
const Ocp = "/sys/devices/ocp.*"
View Source
const Slots = "/sys/devices/bone_capemgr.*"

Variables

This section is empty.

Functions

This section is empty.

Types

type BeagleboneAdaptor

type BeagleboneAdaptor struct {
	gobot.Adaptor
	// contains filtered or unexported fields
}

func NewBeagleboneAdaptor

func NewBeagleboneAdaptor(name string) *BeagleboneAdaptor

func (*BeagleboneAdaptor) AnalogRead

func (b *BeagleboneAdaptor) AnalogRead(pin string) int

func (*BeagleboneAdaptor) Connect

func (b *BeagleboneAdaptor) Connect() bool

func (*BeagleboneAdaptor) DigitalWrite

func (b *BeagleboneAdaptor) DigitalWrite(pin string, val byte)

func (*BeagleboneAdaptor) Disconnect

func (b *BeagleboneAdaptor) Disconnect() bool

func (*BeagleboneAdaptor) Finalize

func (b *BeagleboneAdaptor) Finalize() bool

func (*BeagleboneAdaptor) I2cRead

func (b *BeagleboneAdaptor) I2cRead(size uint) []byte

func (*BeagleboneAdaptor) I2cStart

func (b *BeagleboneAdaptor) I2cStart(address byte)

func (*BeagleboneAdaptor) I2cWrite

func (b *BeagleboneAdaptor) I2cWrite(data []byte)

func (*BeagleboneAdaptor) InitServo

func (b *BeagleboneAdaptor) InitServo()

func (*BeagleboneAdaptor) PwmWrite

func (b *BeagleboneAdaptor) PwmWrite(pin string, val byte)

func (*BeagleboneAdaptor) Reconnect

func (b *BeagleboneAdaptor) Reconnect() bool

func (*BeagleboneAdaptor) ServoWrite

func (b *BeagleboneAdaptor) ServoWrite(pin string, val byte)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL