{"id":18462595,"url":"https://github.com/smarthome-go/infrared","last_synced_at":"2025-04-28T11:15:35.914Z","repository":{"id":110493982,"uuid":"489473371","full_name":"smarthome-go/infrared","owner":"smarthome-go","description":"A Go library used for receiving signals from infrared remote controls","archived":false,"fork":false,"pushed_at":"2022-06-08T22:25:21.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-28T11:15:30.387Z","etag":null,"topics":["golang-library","hardware-libraries","infrared-control","infrared-decoder","raspberry-pi"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/smarthome-go/infrared","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smarthome-go.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-06T19:36:51.000Z","updated_at":"2022-08-10T17:12:04.000Z","dependencies_parsed_at":"2023-03-25T00:49:09.589Z","dependency_job_id":null,"html_url":"https://github.com/smarthome-go/infrared","commit_stats":{"total_commits":13,"total_committers":1,"mean_commits":13.0,"dds":0.0,"last_synced_commit":"aad982250fa261b4475b388c4a07cd26d884a9db"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smarthome-go%2Finfrared","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smarthome-go%2Finfrared/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smarthome-go%2Finfrared/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smarthome-go%2Finfrared/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smarthome-go","download_url":"https://codeload.github.com/smarthome-go/infrared/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251302782,"owners_count":21567601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["golang-library","hardware-libraries","infrared-control","infrared-decoder","raspberry-pi"],"created_at":"2024-11-06T09:03:04.814Z","updated_at":"2025-04-28T11:15:35.892Z","avatar_url":"https://github.com/smarthome-go.png","language":"Go","readme":"# Raspberry-Pi infrared\n A library used for interacting with infrared remote controls via Go.\n\n## Installation / Setup\nTo install the library, issue the following command\n```\ngo get github.com/smarthome-go/infrared  \n```\nYou can then import the library in your project using following code\n```go\nimport \"github.com/smarthome-go/infrared\"\n```\n\n## Getting started\n### Creating a new *instance*\nBefore codes can be scanned, create a new module struct:\n```go\nifScanner := infrared.Scanner{}\n```\nThe `ifScanner` struct now allows you to use the library\n\n### Setting up the input pin\nAfter you have created a new struct, run the `Setup` function to tell the library on which pin in should listen to incoming infrared signals  \nThis can be achieved by using `Scanner.Setup(pin)`\n```go\nifScanner.Setup(4)\n```\nMake sure to implement proper error handling.\nFor reference, take a look at the [Example](#example).\n\n### Using the scanner\nTo scan for codes, use the following function:\n```go\nreceivedCode, err := ifScanner.Scan()\n```\nThe scan function will wait until a code is received, then return it.\nDue to this, it is to be noted that the `Scan` function is blocking, which means you probably want to run this in a separate goroutine.\nThe `Scan` method returns the received code as a `hex` string.\nMake sure to implement proper error handling.\nFor another reference, take a look at the [Example](#example).\n\n\n## Example\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/smarthome-go/infrared\"\n)\n\nfunc main() {\n\tifScanner := infrared.Scanner\n\tif err := ifScanner.Setup(4); err != nil {\n\t\tpanic(err.Error())\n\t}\n\treceivedCode, err := ifScanner.Scan()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(receivedCode)\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmarthome-go%2Finfrared","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmarthome-go%2Finfrared","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmarthome-go%2Finfrared/lists"}