{"id":21521071,"url":"https://github.com/weisjohn/tessel-apple-remote","last_synced_at":"2025-10-04T15:44:18.084Z","repository":{"id":27707986,"uuid":"31194904","full_name":"weisjohn/tessel-apple-remote","owner":"weisjohn","description":"An event-emitter interface to an Apple IR Remote using the Tessel IR Module","archived":false,"fork":false,"pushed_at":"2015-02-26T07:53:26.000Z","size":260,"stargazers_count":5,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-21T16:54:28.064Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/weisjohn.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":"2015-02-23T05:11:49.000Z","updated_at":"2024-06-22T02:57:47.000Z","dependencies_parsed_at":"2022-09-08T16:01:35.132Z","dependency_job_id":null,"html_url":"https://github.com/weisjohn/tessel-apple-remote","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/weisjohn/tessel-apple-remote","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weisjohn%2Ftessel-apple-remote","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weisjohn%2Ftessel-apple-remote/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weisjohn%2Ftessel-apple-remote/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weisjohn%2Ftessel-apple-remote/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/weisjohn","download_url":"https://codeload.github.com/weisjohn/tessel-apple-remote/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weisjohn%2Ftessel-apple-remote/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278335448,"owners_count":25970086,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-24T01:05:39.688Z","updated_at":"2025-10-04T15:44:18.068Z","avatar_url":"https://github.com/weisjohn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tessel-apple-remote\n\nAn event-emitter interface to an Apple IR Remote using the Tessel IR Module\n\nThis module takes the burden off of processing the infared byte buffers and extends the events from [`ir-attx4`](https://github.com/tessel/ir-attx4) to provide a higher-level API for programming against Apple remotes. This module supports both the first and second generation of remotes.\n\n### usage\n\n```javascript\nvar tessel = require('tessel');\nvar port = tessel.port['A'];\nvar apple = require('tessel-apple-remote')(port);\n\napple.on('menu', function() {\n    console.log('menu');\n});\n```\n\n### events\n\nSimple button presses:\n\n - `menu`\n - `center`\n - `up`\n - `down`\n - `right`\n - `left`\n - `play`\n\nEach event name has a corresponding `[name].long` event for long presses:\n\n - `menu.long`\n - `center.long`\n - `up.long`\n - `down.long`\n - `right.long`\n - `left.long`\n - `play.long`\n\nNOTE: both `play` and `play.long` only apply to the 2nd Generation remote.\n\n##### `id`\n\nEach Apple Remote sends along a simple remote ID between 0-255 (0xFF). To differentiate between remotes, you can prefix both the command events and continuation events with that id. For example, if your remote had the ID of 50\n\n```javascript\napple.on('50.menu', function() {\n    console.log('my remote clicked \"menu\"');\n});\n```\n\nTo enable discovery on the fly of remote IDs, an `id` event is emitted, with a value of the new id. This event will only be emitted the first time that ID is encountered.\n\n```javascript\napple.on('id', function(id) {\n    console.log('a new challenger appears', id);\n});\n```\n\nTo test this, you can either use two remotes, or you can first press a button on the remote, notice the `id` event fires, then change your remote's ID by pressing and holding the menu + center buttons for about 10 seconds. After your remote's ID is changed, another `id` event will be emitted on the next button press. See [examples/lockout.js](examples/lockout.js) for an example of how to isolate your code to the first remote to send an event.\n\n##### `data`\n\nThe standard `data` event is unmodified.\n\n```javascript\napple.on('data', function(data) {\n    // access to the low-level duration stream\n    console.log(data.toString('hex'));\n});\n```\n##### `error`\n\nThe standard `error` event is unmodified.\n\n```javascript\napple.on('error', function(error) {\n    console.log(error);\n});\n```\n\n\n### examples\n\n1. Plug the IR module into Port A on your Tessel, then connect via USB\n2. `tessel run [script]` to test scripts in [examples](./examples) folder.\n3. Click buttons on your remote and commence mad science.\n\n\n### notes\n\nHelpful reference material on the implemenation: \n\n - [https://github.com/tessel/ir-attx4#api-infrared-on-data-callback-data-Emitted-when-an-infrared-signal-is-detected](https://github.com/tessel/ir-attx4#api-infrared-on-data-callback-data-Emitted-when-an-infrared-signal-is-detected)\n - [http://techdocs.altium.com/display/FPGA/NEC+Infrared+Transmission+Protocol](http://techdocs.altium.com/display/FPGA/NEC+Infrared+Transmission+Protocol)\n - [http://en.wikipedia.org/wiki/Apple_Remote#Technical_details](http://en.wikipedia.org/wiki/Apple_Remote#Technical_details)\n - [https://github.com/squeed/AppleRemoteSender/blob/master/AppleRemoteSender.cpp](https://github.com/squeed/AppleRemoteSender/blob/master/AppleRemoteSender.cpp)\n - [https://hifiduino.wordpress.com/apple-aluminum-remote/](https://hifiduino.wordpress.com/apple-aluminum-remote/)\n\n### hardware\n\nYou need:\n\n - a [Tessel](https://shop.tessel.io/Base%20Boards/Tessel)\n - an [IR module](https://shop.tessel.io/Modules/Infrared%20Module)\n - either a first-generation (white) Apple remote\n - or a [second-generation (silver) Apple remote](http://store.apple.com/us/product/MC377LL/A/apple-remote)\n\n![](http://i.imgur.com/DqH1EMi.jpg)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweisjohn%2Ftessel-apple-remote","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweisjohn%2Ftessel-apple-remote","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweisjohn%2Ftessel-apple-remote/lists"}