Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nathan-osman/go-rpigpio
Extremely simple Go package for interacting with the GPIO pins on a Raspberry Pi
https://github.com/nathan-osman/go-rpigpio
golang gpio-pins raspberry-pi rpi-gpio
Last synced: 6 days ago
JSON representation
Extremely simple Go package for interacting with the GPIO pins on a Raspberry Pi
- Host: GitHub
- URL: https://github.com/nathan-osman/go-rpigpio
- Owner: nathan-osman
- License: mit
- Created: 2015-11-22T04:57:05.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-09-04T02:22:31.000Z (about 6 years ago)
- Last Synced: 2024-09-24T23:32:24.326Z (9 days ago)
- Topics: golang, gpio-pins, raspberry-pi, rpi-gpio
- Language: Go
- Size: 2.93 KB
- Stars: 62
- Watchers: 7
- Forks: 15
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
## go-rpigpio
[![GoDoc](https://godoc.org/github.com/nathan-osman/go-rpigpio?status.svg)](https://godoc.org/github.com/nathan-osman/go-rpigpio)
[![MIT License](http://img.shields.io/badge/license-MIT-9370d8.svg?style=flat)](http://opensource.org/licenses/MIT)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)