cd1a016b2b | ||
---|---|---|
.. | ||
README.md | ||
doc.go | ||
edison_adaptor.go | ||
edison_adaptor_test.go | ||
pwm_pin.go |
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()
}