Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 691 Bytes

README.md

File metadata and controls

24 lines (16 loc) · 691 Bytes

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)