gobotBeaglebone

package module
v0.0.0-...-c219639 Latest Latest
Warning

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

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

README

gobot-beaglebone

Gobot (http://gobot.io/) is a library for robotics and physical computing using Go

This library provides an adaptor and driver for the Beaglebone Black (http://beagleboard.org/Products/BeagleBone+Black/)

Build Status Coverage Status

Getting Started

Install the library with: go get -u github.com/hybridgroup/gobot-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/blink.go

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

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

Example

package main

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

func main() {
        beaglebone := new(gobotBeaglebone.Beaglebone)
        beaglebone.Name = "beaglebone"

        led := gobotGPIO.NewLed(beaglebone)
        led.Name = "led"
        led.Pin = "P9_12"

        work := func() {
                gobot.Every("1s", func() { led.Toggle() })
        }

        robot := gobot.Robot{
                Connections: []interface{}{beaglebone},
                Devices:     []interface{}{led},
                Work:        work,
        }

        robot.Start()
}

Documentation

We're busy adding documentation to our web site at http://gobot.io/ please check there as we continue to work on Gobot

Thank you!

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality.

License

Copyright (c) 2013 The Hybrid Group. Licensed under the Apache 2.0 license.

Documentation

Index

Constants

View Source
const GPIO_DIRECTION_READ = "in"
View Source
const GPIO_DIRECTION_WRITE = "out"
View Source
const GPIO_PATH = "/sys/class/gpio"
View Source
const HIGH = 1
View Source
const I2C_LOCATION = "/dev/i2c-1"
View Source
const I2C_SLAVE = 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 Beaglebone

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

func (*Beaglebone) AnalogRead

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

func (*Beaglebone) Connect

func (b *Beaglebone) Connect() bool

func (*Beaglebone) DigitalWrite

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

func (*Beaglebone) Disconnect

func (b *Beaglebone) Disconnect() bool

func (*Beaglebone) Finalize

func (b *Beaglebone) Finalize() bool

func (*Beaglebone) I2cRead

func (b *Beaglebone) I2cRead(size byte) []byte

func (*Beaglebone) I2cStart

func (b *Beaglebone) I2cStart(address byte)

func (*Beaglebone) I2cWrite

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

func (*Beaglebone) InitServo

func (b *Beaglebone) InitServo()

func (*Beaglebone) PwmWrite

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

func (*Beaglebone) Reconnect

func (b *Beaglebone) Reconnect() bool

func (*Beaglebone) ServoWrite

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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