News

2022-05-29 Cleaning up the old cruft to align on the future: Removing periph.io/x/periph
2021-05-29 main: Renamed all repositories master branch to main
2020-12-30 A new start: A new layout for Go modules in v3.6.7
2020-12-04 Announcing v3.6.5: Let's just hope 2020 ends quickly
2019-08-27 Announcing v3.6.2: Fixing go modules users
2019-08-23 Announcing v3.6.1: RPi1 and Rpi Zero GPIO and amd64
See all 22 news entry...

boardimage

Overview

Periph is a standalone hardware library with limited external dependencies.

Features

Platforms

Devices

Tools

periph includes many ready-to-use tools:

go get periph.io/x/cmd/...
# List the host drivers registered and/or initialized:
periph-info
# List the board headers:
headers-list
# List the state of each GPIO:
gpio-list
# Set P1_7/GPIO4 on a Raspberry Pi to high:
gpio-write P1_7 1

Library

periph tries hard to get out of the way when used as a library.

Here’s the minimal “toggle a LED” example:

package main

import (
    "time"
    "periph.io/x/conn/v3/gpio"
    "periph.io/x/conn/v3/gpio/gpioreg"
    "periph.io/x/host/v3"
)

func main() {
    host.Init()
    p := gpioreg.ByName("11")
    t := time.NewTicker(500 * time.Millisecond)
    for l := gpio.Low; ; l = !l {
        p.Out(l)
        <-t.C
    }
}

Learn more about GPIOs.

boardimage

More infos

Contact

Authors

periph was initiated with ❤️️ and passion by Marc-Antoine Ruel. The full list of contributors is in AUTHORS and CONTRIBUTORS in each repository.

Disclaimer

This is not an official Google product (experimental or otherwise), it is just code that happens to be owned by Google.

This project is not affiliated with the Go project.