{"action":"created","issue":{"url":"https://api.github.com/repos/tessel/t2-firmware/issues/107","repository_url":"https://api.github.com/repos/tessel/t2-firmware","labels_url":"https://api.github.com/repos/tessel/t2-firmware/issues/107/labels{/name}","comments_url":"https://api.github.com/repos/tessel/t2-firmware/issues/107/comments","events_url":"https://api.github.com/repos/tessel/t2-firmware/issues/107/events","html_url":"https://github.com/tessel/t2-firmware/issues/107","id":111982135,"number":107,"title":"Add API for Button functionality","user":{"login":"HipsterBrown","id":3051193,"avatar_url":"https://avatars.githubusercontent.com/u/3051193?v=3","gravatar_id":"","url":"https://api.github.com/users/HipsterBrown","html_url":"https://github.com/HipsterBrown","followers_url":"https://api.github.com/users/HipsterBrown/followers","following_url":"https://api.github.com/users/HipsterBrown/following{/other_user}","gists_url":"https://api.github.com/users/HipsterBrown/gists{/gist_id}","starred_url":"https://api.github.com/users/HipsterBrown/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HipsterBrown/subscriptions","organizations_url":"https://api.github.com/users/HipsterBrown/orgs","repos_url":"https://api.github.com/users/HipsterBrown/repos","events_url":"https://api.github.com/users/HipsterBrown/events{/privacy}","received_events_url":"https://api.github.com/users/HipsterBrown/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-10-17T20:01:31Z","updated_at":"2016-04-15T09:41:41Z","closed_at":null,"body":"There is currently no way to access the button input on tessel-2. \r\nhttps://tessel.io/docs/hardwareAPI#button-and-leds\r\n\r\nWhat would it take to add this functionality to the `tessel-export.js` module?\r\n"},"comment":{"url":"https://api.github.com/repos/tessel/t2-firmware/issues/comments/210387960","html_url":"https://github.com/tessel/t2-firmware/issues/107#issuecomment-210387960","issue_url":"https://api.github.com/repos/tessel/t2-firmware/issues/107","id":210387960,"user":{"login":"johnnyman727","id":432909,"avatar_url":"https://avatars.githubusercontent.com/u/432909?v=3","gravatar_id":"","url":"https://api.github.com/users/johnnyman727","html_url":"https://github.com/johnnyman727","followers_url":"https://api.github.com/users/johnnyman727/followers","following_url":"https://api.github.com/users/johnnyman727/following{/other_user}","gists_url":"https://api.github.com/users/johnnyman727/gists{/gist_id}","starred_url":"https://api.github.com/users/johnnyman727/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnnyman727/subscriptions","organizations_url":"https://api.github.com/users/johnnyman727/orgs","repos_url":"https://api.github.com/users/johnnyman727/repos","events_url":"https://api.github.com/users/johnnyman727/events{/privacy}","received_events_url":"https://api.github.com/users/johnnyman727/received_events","type":"User","site_admin":false},"created_at":"2016-04-15T09:41:41Z","updated_at":"2016-04-15T09:41:41Z","body":"@brianarn thanks for the feedback @brianarn!\r\n\r\nThis PR would be challenging for a first-timer but not impossible. Here is how I would approach it:\r\n\r\n- [ ] add an interrupt handler in the firmware running on SAMD21 for the pin the button is on. You'll want to check out the [schematic](https://s3.amazonaws.com/design-files.tessel.io/2015-06-20/tessel-v2.pdf) to see the pin assignments check out how we already [set interrupts on other pins](https://github.com/tessel/t2-firmware/blob/master/firmware/port.c#L349).\r\n- [ ] When [you get a pin interrupt in JS](https://github.com/tessel/t2-firmware/blob/master/node/tessel-export.js#L253), check to see if it was a change on the button, and emit as a `button` event.\r\n"}}