nathan-osman / go-rpigpio

Extremely simple Go package for interacting with the GPIO pins on a Raspberry Pi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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)

About

Extremely simple Go package for interacting with the GPIO pins on a Raspberry Pi

License:MIT License


Languages

Language:Go 100.0%