Which package to use to use GPIO on Raspberry Pi?

How can I read GPIO temperature sensor values ​​for raspberry Pi using go language?

Please help me.

Thanks in advance.

+8
go gpio
source share
4 answers

Check out the Dave Cheney package:

There is a classic blink example .

+5
source share

http://embd.kidoman.io/

this is a slightly higher level of abstraction than the dave cheney gpio library.

In addition to the gpio api, there is support for many common sensors

not sure what your sensor is, but for example, here is an example for a bmp180 barometric sensor

+3
source share

I created an extremely simple package for interacting with GPIO contacts on a raspberry Pi:

https://github.com/nathan-osman/go-rpigpio

A simple program that makes a flash flash 10 times looks something like this:

package main import ( "github.com/nathan-osman/go-rpigpio" "time" ) func main() { p, err := rpi.OpenPin(2, rpi.OUT) if err != nil { panic(err) } defer p.Close() for i := 0; i < 10; i++ { p.Write(rpi.HIGH) time.Sleep(300 * time.Millisecond) p.Write(rpi.LOW) time.Sleep(100 * time.Millisecond) } } 

Further documentation can be found here .

+3
source share

Another goPi - also supports piface

And blinking examples

0
source share

All Articles