grovepi

package
v0.0.0-...-958c689 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2016 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	A0 = "A0"
	A1 = "A1"
	A2 = "A2"
	D2 = "D2"
	D3 = "D3"
	D4 = "D4"
	D5 = "D5"
	D6 = "D6"
	D7 = "D7"
	D8 = "D8"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GrovePI

type GrovePI struct {
	Conn *i2c.Device
	// contains filtered or unexported fields
}

func New

func New(i2co driver.Opener) (*GrovePI, error)

func (*GrovePI) Close

func (g *GrovePI) Close() error

Close closes the connection and frees the underlying resources.

func (*GrovePI) GetValue

func (g *GrovePI) GetValue(pin string) (int, error)

GetValue gets the value of the pin. 0 for low values, 1 for high.

func (*GrovePI) Map

func (g *GrovePI) Map(virtual string, physical int)

Map should map a virtual GPIO pin number to a physical pin number. This is also useful to configure driver implementations for boards with different GPIO pin layouts. E.g. GPIO 25 pin on a Raspberry Pi, can be represented by a different physical pin out on a different board.

func (*GrovePI) Open

func (g *GrovePI) Open() (gpiodriver.Conn, error)

func (*GrovePI) SetDirection

func (g *GrovePI) SetDirection(pin string, dir gpiodriver.Direction) error

SetDirection sets the direction of the pin.

func (*GrovePI) SetValue

func (g *GrovePI) SetValue(pin string, v int) error

SetValue sets the value of the pin. 0 for low values, 1 for high.

func (*GrovePI) Value

func (g *GrovePI) Value(pin string) (int, error)

Value returns the value of the pin. 0 for low values, 1 for high.

Jump to

Keyboard shortcuts

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