gitwtfhub

wtf is go-wiringpi?

eternal-flame-ad/go-wiringpi — explained in plain English

Analysis updated 2026-07-19 · repo last pushed 2019-02-28

4GoAudience · developerComplexity · 2/5DormantSetup · moderate

TL;DR

A Go library that lets your code control the physical pins on a Raspberry Pi, so Go programs can read sensors and control motors, lights, and other hardware directly.

Mindmap

mindmap
  root((repo))
    What it does
      Controls Pi pins
      Reads input signals
      Writes output signals
    Capabilities
      Hardware PWM
      Digital IO
      Pin setup
    Not yet done
      I2C support
      SPI support
      Software PWM
    Use cases
      Door sensor
      Custom thermostat
      Button robot
    Tech stack
      Go language
      C library wrapper
      WiringPi
    Audience
      Hardware tinkerers
      Go developers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Build a door sensor that logs entries when a switch closes.

REASON 2

Create a custom thermostat that reads a temperature sensor and controls a heater.

REASON 3

Make a robot that responds to physical button presses.

REASON 4

Control LED brightness or motor speed using hardware PWM signals.

What's in the stack?

GoCWiringPi

How it stacks up

eternal-flame-ad/go-wiringpiaeneasr/github-trendsbxcodec/go-simple-flatbuffer
Stars444
LanguageGoGoGo
Last pushed2019-02-282020-12-182017-06-09
MaintenanceDormantDormantDormant
Setup difficultymoderateeasyeasy
Complexity2/52/52/5
Audiencedeveloperpm founderdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 30min

Requires a Raspberry Pi and the WiringPi C library to be installed before Go programs can compile and run.

Wtf does this do

This project lets programmers use the Go language to talk to the physical pins on a Raspberry Pi. If you're building something where code needs to react to the real world, this gives you the bridge to make it happen. At a technical level, it wraps a popular C library called WiringPi so that Go programs can call the same functions without leaving their comfort zone. You initialize the pin system, set a pin to be an input or output, then read whether a pin is currently high or low or write a value to it. It also supports hardware PWM, which is a way to send variable power signals to control things like motor speed or LED brightness with precision. The target user is someone writing Go code on a Raspberry Pi for a hardware project. For example, you might build a door sensor that logs entries, a custom thermostat, or a robot that responds to button presses. If your prototype needs to detect a switch closure or turn on a light based on a condition in your Go program, this is the tool for that job. The project is still a work in progress. Basic pin operations and hardware PWM are done, but support for I2C and SPI (two common ways to communicate with more complex sensors and chips) and software PWM are listed as not yet implemented. That means it works well for simple digital input and output today, but if your project needs to talk to fancier peripherals, you may need to wait or look elsewhere.

Yoink these prompts

Prompt 1
Using the go-wiringpi library on my Raspberry Pi, write a Go program that reads a button press on GPIO pin 17 and turns on an LED on pin 18 when the button is held down.
Prompt 2
Write a Go program using go-wiringpi that uses hardware PWM to fade an LED in and out smoothly on a Raspberry Pi.
Prompt 3
Create a Go program with go-wiringpi that monitors a magnetic door sensor on a Raspberry Pi and prints a timestamped log entry every time the door opens.
Prompt 4
Help me set up a Go project on my Raspberry Pi that uses go-wiringpi to toggle a relay switch every 5 seconds.

Frequently asked questions

wtf is go-wiringpi?

A Go library that lets your code control the physical pins on a Raspberry Pi, so Go programs can read sensors and control motors, lights, and other hardware directly.

What language is go-wiringpi written in?

Mainly Go. The stack also includes Go, C, WiringPi.

Is go-wiringpi actively maintained?

Dormant — no commits in 2+ years (last push 2019-02-28).

How hard is go-wiringpi to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is go-wiringpi for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.