Periph is a standalone hardware library with limited external dependencies.
cgo
.Linux
Generic linux support for any board
macOS
hack on your laptop
Windows
hack on your laptop
BeagleBone
Series of high quality boards
C.H.I.P.
NextThing Co's board
Jetson Nano Developer Kit
NVIDIA Jetson Nano module and carrier board
ODROID-C1
HardKernel board
Raspberry Pi
running Raspbian Lite
APA102
13 bits LEDs
BMxx80
Family of atmospheric sensors
Button
React to button presses without polling
Buzzer
Annoy your friends with noise
CAP1xxx
Family of capacitive touch sensors
DS18b20
Inexpensive temperature sensor
DS248x
1-wire interface over I²C
Fan
Move air across to cool a embedded components.
FLIR Lepton
InfraRed Thermal Camera
FTDI FT232x
Fast USB multi-protocol connectivity
GPIO
Generic digital input/output support
INA219
High side current voltage and power sensor
IR remote
InfraRed remote support
LED
Toggle a LED is the first step
MF-RC522
MIFARE and NTAG frontend
Motion detector
Detect motion without polling
SSD1306
1 bit OLED display controller
TM1637
Segment controller
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
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.
periph
was initiated with ❤️️ and passion by Marc-Antoine
Ruel. The full list of contributors is in AUTHORS
and CONTRIBUTORS in each repository.
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.