Extremely simple Go package for interacting with the GPIO pins on a Raspberry Pi
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE.txt
README.md
pin.go

README.md

go-rpigpio

GoDoc MIT License

This package provides a really simple interface for interacting with the GPIO pins on a Raspberry Pi.

Usage

The following example demonstrates writing to GPIO2:

import "github.com/nathan-osman/go-rpigpio"

p, err := rpi.OpenPin(2, rpi.OUT)
if err != nil {
    panic(err)
}
defer p.Close()

// set the pin to high (on)
p.Write(rpi.HIGH)

// set the pin to low (off)
p.Write(rpi.LOW)