edison

package
v0.0.0-...-dd86721 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2015 License: Apache-2.0, Apache-2.0 Imports: 8 Imported by: 0

README

Edison

The Intel Edison is a wifi and Bluetooth® enabled devolopment platform for the Internet of Things. It packs a robust set of features into its small size and supports a broad spectrum of I/O and software support.

For more info about the Edison platform click here.

How to Install

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

How to Use

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()
}

How to Connect

The Intel Edison Getting Started Guide details connection instructions for Windows, Mac and Linux.

Documentation

Overview

Package edison contains the Gobot adaptor for the Intel Edison.

For further information refer to intel-iot README: https://github.com/hybridgroup/gobot/blob/master/platforms/intel-iot/edison/README.md

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EdisonAdaptor

type EdisonAdaptor struct {
	// contains filtered or unexported fields
}

func NewEdisonAdaptor

func NewEdisonAdaptor(name string) *EdisonAdaptor

NewEditionAdaptor creates a EdisonAdaptor with specified name and creates connect function

func (*EdisonAdaptor) AnalogRead

func (e *EdisonAdaptor) AnalogRead(pin string) (val int, err error)

AnalogRead returns value from analog reading of specified pin

func (*EdisonAdaptor) Connect

func (e *EdisonAdaptor) Connect() (errs []error)

Connect starts conection with board and creates digitalPins and pwmPins adaptor maps

func (*EdisonAdaptor) DigitalRead

func (e *EdisonAdaptor) DigitalRead(pin string) (i int, err error)

DigitalRead reads digital value from pin

func (*EdisonAdaptor) DigitalWrite

func (e *EdisonAdaptor) DigitalWrite(pin string, val byte) (err error)

DigitalWrite writes digital value to specified pin

func (*EdisonAdaptor) Finalize

func (e *EdisonAdaptor) Finalize() (errs []error)

Finalize closes connection to board and pins

func (*EdisonAdaptor) I2cRead

func (e *EdisonAdaptor) I2cRead(size uint) (data []byte, err error)

I2cRead reads data from i2cDevice

func (*EdisonAdaptor) I2cStart

func (e *EdisonAdaptor) I2cStart(address byte) (err error)

I2cStart initializes i2c device for addresss

func (*EdisonAdaptor) I2cWrite

func (e *EdisonAdaptor) I2cWrite(data []byte) (err error)

I2cWrite writes data to i2cDevice

func (*EdisonAdaptor) Name

func (e *EdisonAdaptor) Name() string

func (*EdisonAdaptor) PwmWrite

func (e *EdisonAdaptor) PwmWrite(pin string, val byte) (err error)

PwmWrite writes scaled pwm value to specified pin

Jump to

Keyboard shortcuts

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