hybridgroup.gobot/platforms/intel-iot/edison
Adrian Zankich abc1f0b201 Update platforms to support the new Driver and Adaptor interfaces 2014-11-16 12:25:48 -08:00
..
README.md Add Edison Support 2014-09-23 21:35:29 -07:00
doc.go Update docs 2014-10-28 14:52:59 -07:00
edison_adaptor.go Update platforms to support the new Driver and Adaptor interfaces 2014-11-16 12:25:48 -08:00
edison_adaptor_test.go Update platforms to support the new Driver and Adaptor interfaces 2014-11-16 12:25:48 -08:00
pwm_pin.go Refactor edsion tests 2014-11-07 18:37:57 -08:00

README.md

Edison

This package contains the Gobot adaptor for the Intel Edison IoT platform.

This package currently supports the following Intel IoT hardware:

  • Intel Edison with the Arduino breakout board

Getting Started

First you must install the appropriate Go packages

go get github.com/hybridgroup/gobot && go install github.com/hybridgroup/gobot/platforms/intel-iot/edison

Setting up your Intel Edison

Everything you need to get started with the Edison is in the Intel Getting Started Guide located here. Don't forget to configure your Edison's wifi connection and flash your Edison with the latest firmware image!

Cross compiling for the Intel Edison

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

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

Then compile your Gobot program with

$ GOARCH=386 GOOS=linux go build examples/edison_blink.go

Then you can simply upload your program over the network from your host computer to the Edison

$ scp edison_blink root@192.168.1.xxx:/home/root/

and execute it on your Edison with

$ ./edison_blink

Example

package main

import (
	"time"

	"github.com/hybridgroup/gobot"
	"github.com/hybridgroup/gobot/platforms/gpio"
	"github.com/hybridgroup/gobot/platforms/intel-iot/edison"
)

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

	e := edison.NewEdisonAdaptor("edison")
	led := gpio.NewLedDriver(e, "led", "13")

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

	robot := gobot.NewRobot("blinkBot",
		[]gobot.Connection{e},
		[]gobot.Device{led},
		work,
	)

	gbot.AddRobot(robot)

	gbot.Start()
}