{"id":19155580,"url":"https://github.com/raspberrypi-go-drivers/button","last_synced_at":"2026-05-08T09:31:53.017Z","repository":{"id":57558588,"uuid":"322683719","full_name":"raspberrypi-go-drivers/button","owner":"raspberrypi-go-drivers","description":"Driver allowing to read the state of a button","archived":false,"fork":false,"pushed_at":"2020-12-18T19:43:43.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-21T06:35:00.764Z","etag":null,"topics":["driver","go","golang","raspberrypi","raspberrypi-drivers","robotics"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raspberrypi-go-drivers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-18T19:13:09.000Z","updated_at":"2020-12-19T10:36:33.000Z","dependencies_parsed_at":"2022-09-15T19:30:59.573Z","dependency_job_id":null,"html_url":"https://github.com/raspberrypi-go-drivers/button","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/raspberrypi-go-drivers/button","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspberrypi-go-drivers%2Fbutton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspberrypi-go-drivers%2Fbutton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspberrypi-go-drivers%2Fbutton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspberrypi-go-drivers%2Fbutton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raspberrypi-go-drivers","download_url":"https://codeload.github.com/raspberrypi-go-drivers/button/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspberrypi-go-drivers%2Fbutton/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32774723,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["driver","go","golang","raspberrypi","raspberrypi-drivers","robotics"],"created_at":"2024-11-09T08:31:15.614Z","updated_at":"2026-05-08T09:31:52.984Z","avatar_url":"https://github.com/raspberrypi-go-drivers.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Button\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/raspberrypi-go-drivers/button.svg)](https://pkg.go.dev/github.com/raspberrypi-go-drivers/button)\n![golangci-lint](https://github.com/raspberrypi-go-drivers/button/workflows/golangci-lint/badge.svg)\n[![Go Report Card](https://goreportcard.com/badge/github.com/raspberrypi-go-drivers/button)](https://goreportcard.com/report/github.com/raspberrypi-go-drivers/button)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nThis drivers allows interact with a button connected to the GPIO\n\n## Documentation\n\nFor full documentation, please visit [![Go Reference](https://pkg.go.dev/badge/github.com/raspberrypi-go-drivers/button.svg)](https://pkg.go.dev/github.com/raspberrypi-go-drivers/button)\n\n## Quick start\n\n```go\nimport (\n\t\"fmt\"\n\n\t\"github.com/raspberrypi-go-drivers/button\"\n\t\"github.com/stianeikeland/go-rpio/v4\"\n\tlog \"github.com/sirupsen/logrus\"\n)\n\nfunc main() {\n\terr := rpio.Open()\n\tif err != nil {\n\t\tos.Exit(1)\n\t}\n\tdefer rpio.Close()\n\tb1 := button.NewButton(17)\n\tif err := b1.EnableEventDetection(); err != nil {\n\t\tlog.WithField(\"error\", err).Error(\"impossible to enable edge detection\")\n\t}\n\tfor event := range b1.EventChan {\n\t\tif event == button.Pressed {\n\t\t\tfmt.Println(\"Button pressed\")\n\t\t} else if event == button.Released {\n\t\t\tfmt.Println(\"Button released\")\n\t\t}\n\t}\n}\n```\n\n## Raspberry Pi compatibility\n\nThis driver has has only been tested on an Raspberry Pi Zero WH but should work well on every Raspberry Pi\n\n## License\n\nMIT License\n\n---\n\nSpecial thanks to @stianeikeland\n\nThis driver is based on his work in [stianeikeland/go-rpio](https://github.com/stianeikeland/go-rpio/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraspberrypi-go-drivers%2Fbutton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraspberrypi-go-drivers%2Fbutton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraspberrypi-go-drivers%2Fbutton/lists"}