i2c

package
v0.0.0-...-d941a39 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2014 License: Apache-2.0, Apache-2.0 Imports: 2 Imported by: 0

README

I2C

This package provides drivers for i2cdevices . It is normally not used directly, but instead is registered by an adaptor such as firmata that supports the needed interfaces for i2c devices.

Getting Started

Installing

go get github.com/hybridgroup/gobot && go install github.com/hybridgroup/platforms/i2c

Hardware Support

Gobot has a extensible system for connecting to hardware devices. The following i2c devices are currently supported:

  • BlinkM
  • HMC6352 Digital Compass
  • Wii Nunchuck Controller

More drivers are coming soon...

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlinkMDriver

type BlinkMDriver struct {
	gobot.Driver
	Adaptor I2cInterface
}

func NewBlinkMDriver

func NewBlinkMDriver(a I2cInterface, name string) *BlinkMDriver

func (*BlinkMDriver) Color

func (b *BlinkMDriver) Color() []byte

func (*BlinkMDriver) Fade

func (b *BlinkMDriver) Fade(red byte, green byte, blue byte)

func (*BlinkMDriver) FirmwareVersion

func (b *BlinkMDriver) FirmwareVersion() string

func (*BlinkMDriver) Halt

func (b *BlinkMDriver) Halt() bool

func (*BlinkMDriver) Init

func (b *BlinkMDriver) Init() bool

func (*BlinkMDriver) Rgb

func (b *BlinkMDriver) Rgb(red byte, green byte, blue byte)

func (*BlinkMDriver) Start

func (b *BlinkMDriver) Start() bool

type HMC6352Driver

type HMC6352Driver struct {
	gobot.Driver
	Adaptor I2cInterface
	Heading uint16
}

func NewHMC6352Driver

func NewHMC6352Driver(a I2cInterface, name string) *HMC6352Driver

func (*HMC6352Driver) Halt

func (h *HMC6352Driver) Halt() bool

func (*HMC6352Driver) Init

func (h *HMC6352Driver) Init() bool

func (*HMC6352Driver) Start

func (h *HMC6352Driver) Start() bool

type I2cInterface

type I2cInterface interface {
	I2cStart(byte)
	I2cRead(uint) []byte
	I2cWrite([]byte)
}

type WiichuckDriver

type WiichuckDriver struct {
	gobot.Driver
	// contains filtered or unexported fields
}

func NewWiichuckDriver

func NewWiichuckDriver(a I2cInterface, name string) *WiichuckDriver

func (*WiichuckDriver) Halt

func (w *WiichuckDriver) Halt() bool

func (*WiichuckDriver) Init

func (w *WiichuckDriver) Init() bool

func (*WiichuckDriver) Start

func (w *WiichuckDriver) Start() bool

Jump to

Keyboard shortcuts

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