raspi-gpio

command
v0.0.0-...-a2a1f02 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2020 License: MIT Imports: 5 Imported by: 0

README

raspi-gpio example

Using googles periph (peripherals in go) library to control a Raspberry Pi's GPIO (General Purpose Input/Output) pins. The example used will be turning on/off an external LED via a button.

Documents and references,

GitHub Webpage

PREREQUISITE

go get -u periph.io/x/periph/cmd/...

Will use include as,

    "periph.io/x/periph/conn/gpio"
    "periph.io/x/periph/conn/gpio/gpioreg"
    "periph.io/x/periph/host"

I also created following group,

sudo groupadd gpio
sudo usermod -a -G gpio jeff
sudo grep gpio /etc/group
sudo chown root.gpio /dev/gpiomem
sudo chmod g+rw /dev/gpiomem

GPIO TO BREADBOARD SCHEMATIC

We will control the LED via a button on the Raspberry Pi with the following setup,

IMAGE - raspberry-pi-input-and-output-using-gpio-pins - IMAGE

RUN

go run raspi-gpio.go

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL