{"action":"created","issue":{"url":"https://api.github.com/repos/firmata/arduino/issues/174","labels_url":"https://api.github.com/repos/firmata/arduino/issues/174/labels{/name}","comments_url":"https://api.github.com/repos/firmata/arduino/issues/174/comments","events_url":"https://api.github.com/repos/firmata/arduino/issues/174/events","html_url":"https://github.com/firmata/arduino/pull/174","id":52606759,"number":174,"title":"Analog config","user":{"login":"soundanalogous","id":401539,"avatar_url":"https://avatars.githubusercontent.com/u/401539?v=3","gravatar_id":"","url":"https://api.github.com/users/soundanalogous","html_url":"https://github.com/soundanalogous","followers_url":"https://api.github.com/users/soundanalogous/followers","following_url":"https://api.github.com/users/soundanalogous/following{/other_user}","gists_url":"https://api.github.com/users/soundanalogous/gists{/gist_id}","starred_url":"https://api.github.com/users/soundanalogous/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soundanalogous/subscriptions","organizations_url":"https://api.github.com/users/soundanalogous/orgs","repos_url":"https://api.github.com/users/soundanalogous/repos","events_url":"https://api.github.com/users/soundanalogous/events{/privacy}","received_events_url":"https://api.github.com/users/soundanalogous/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-12-21T21:30:54Z","updated_at":"2015-05-20T03:41:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/firmata/arduino/pulls/174","html_url":"https://github.com/firmata/arduino/pull/174","diff_url":"https://github.com/firmata/arduino/pull/174.diff","patch_url":"https://github.com/firmata/arduino/pull/174.patch"},"body":"This is an evolution of https://github.com/firmata/arduino/pull/40 so I opened a new pull for it. However adding this functionality is not so straight forward. There are 2 major issues:\r\n\r\n1. Only SAM-based variants include the methods `analogReadResolution` and `analogWriteResolution`.\r\n\r\n2. Only AVR-based variants support setting the analogReference value. SAM variants have an `analogReference` method, but it is set with a typedef value rather than a constant. Furthermore, the DEFAULT and EXTERNAL are defined for SAM variants, but they cannot be passed to `analogReference` since `analogReference` expects a parameter of type `eAnalogReference` which is a type created specifically for SAM variants.\r\n\r\nThere appears to be no clean implementation possible here. I'd have to pick an existing define that is unique to each architecture and use that to determine whether a board is of SAM or AVR architecture, or I'd have to add some defines to Boards.h to sort it out."},"comment":{"url":"https://api.github.com/repos/firmata/arduino/issues/comments/103745141","html_url":"https://github.com/firmata/arduino/pull/174#issuecomment-103745141","issue_url":"https://api.github.com/repos/firmata/arduino/issues/174","id":103745141,"user":{"login":"soundanalogous","id":401539,"avatar_url":"https://avatars.githubusercontent.com/u/401539?v=3","gravatar_id":"","url":"https://api.github.com/users/soundanalogous","html_url":"https://github.com/soundanalogous","followers_url":"https://api.github.com/users/soundanalogous/followers","following_url":"https://api.github.com/users/soundanalogous/following{/other_user}","gists_url":"https://api.github.com/users/soundanalogous/gists{/gist_id}","starred_url":"https://api.github.com/users/soundanalogous/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soundanalogous/subscriptions","organizations_url":"https://api.github.com/users/soundanalogous/orgs","repos_url":"https://api.github.com/users/soundanalogous/repos","events_url":"https://api.github.com/users/soundanalogous/events{/privacy}","received_events_url":"https://api.github.com/users/soundanalogous/received_events","type":"User","site_admin":false},"created_at":"2015-05-20T03:41:20Z","updated_at":"2015-05-20T03:41:20Z","body":"Arduino Zero uses 12-bit ADC"}}