hybridgroup.gobot/platforms/beaglebone
deadprogram 79e7f34a88 core: Refactor Beaglebone platform for new Adaptor creation signatures
Signed-off-by: deadprogram <ron@hybridgroup.com>
2016-09-25 14:12:52 +02:00
..
LICENSE misc: update all LICENSE files for current year 2016-08-27 13:12:47 +02:00
README.md core: Refactor Beaglebone platform for new Adaptor creation signatures 2016-09-25 14:12:52 +02:00
beaglebone_adaptor.go core: Refactor Beaglebone platform for new Adaptor creation signatures 2016-09-25 14:12:52 +02:00
beaglebone_adaptor_test.go core: Refactor Beaglebone platform for new Adaptor creation signatures 2016-09-25 14:12:52 +02:00
doc.go core: Refactor Beaglebone platform for new Adaptor creation signatures 2016-09-25 14:12:52 +02:00
pwm_pin.go Refactor pwm operations 2014-12-23 18:35:45 -08:00

README.md

Beaglebone

The BeagleBone is an ARM based single board computer, with many different GPIO interfaces built in.

For more info about the BeagleBone platform click here.

How to Install

go get -d -u github.com/hybridgroup/gobot/... && go install github.com/hybridgroup/gobot/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"

How to Use

package main

import (
	"time"

	"github.com/hybridgroup/gobot"
	"github.com/hybridgroup/gobot/platforms/beaglebone"
	"github.com/hybridgroup/gobot/drivers/gpio"
)

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

	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,
	)

	gbot.AddRobot(robot)

	gbot.Start()
}