pi

package module
v0.0.0-...-a91e37c Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2020 License: Apache-2.0 Imports: 2 Imported by: 2

README

pi

linux arm projects

Documentation

Index

Constants

View Source
const (
	IN  = iota // pin is used for input
	OUT        // pin is used for output
)
View Source
const (
	LOW  = iota // pin is low (off)
	HIGH        // pin is high (on)
)

Variables

This section is empty.

Functions

func Sleep

func Sleep(us int)

Types

type Direction

type Direction int

Indicate whether the pin is used for input or output.

type Pin

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

An individual GPIO pin.

func OpenPin

func OpenPin(number int) (*Pin, error)

Prepare a pin for input or output.

func (*Pin) Close

func (p *Pin) Close() error

Close the pin.

func (*Pin) Read

func (p *Pin) Read() (Value, error)

Read the current value of the pin.

func (*Pin) Set

func (p *Pin) Set(direction Direction) error

func (*Pin) Write

func (p *Pin) Write(value Value) error

Set the current value of the pin.

type Value

type Value int

Indicate the current state of the pin.

Directories

Path Synopsis
apps
led

Jump to

Keyboard shortcuts

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