{"action":"created","comment":{"url":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/comments/44232008","id":44232008,"diff_hunk":"@@ -0,0 +1,112 @@\n+Input/Output Pins\n+*****************\n+\n+.. py:module:: microbit\n+\n+The pins are your board's way to communicate with external devices connected to\n+it. There are 19 pins for your disposal, numbered 0-16 and 19-20. Pins 17 and\n+18 are not available.\n+\n+.. image:: pinout.png\n+\n+Those pins are available as attributes on the ``microbit``\n+module:``microbit.pin0`` - ``microbit.pin20``.\n+\n++-----+---------+----------+\n+| Pin | Type    | Function |\n++=====+=========+==========+\n+|  0  | Touch   | Pad 0    |\n++-----+---------+----------+\n+|  1  | Touch   | Pad 1    |\n++-----+---------+----------+\n+|  2  | Touch   | Pad 2    |\n++-----+---------+----------+\n+|  3  | Analog  | Column 1 |\n++-----+---------+----------+\n+|  4  | Digital | Button A |\n++-----+---------+----------+\n+|  5  | Analog  | Column 2 |\n++-----+---------+----------+\n+|  6  | Digital | Row 2    |\n++-----+---------+----------+\n+|  7  | Digital | Row 1    |\n++-----+---------+----------+\n+|  8  | Digital |          |\n++-----+---------+----------+\n+|  9  | Digital | Row 3    |\n++-----+---------+----------+\n+|  10 | Analog  | Column 3 |\n++-----+---------+----------+\n+|  11 | Digital | Button B |\n++-----+---------+----------+\n+|  12 | Digital |          |\n++-----+---------+----------+\n+|  13 | Digital | SPI MOSI |\n++-----+---------+----------+\n+|  14 | Digital | SPI MISO |\n++-----+---------+----------+\n+|  15 | Digital | SPI SCK  |\n++-----+---------+----------+\n+|  16 | Digital |          |\n++-----+---------+----------+\n++-----+---------+----------+\n+|  19 | Digital | I2C SCL  |\n++-----+---------+----------+\n+|  20 | Digital | I2C SDA  |\n++-----+---------+----------+\n+\n+The above table summarizes the pins available, their types (see below) and what\n+they are internally connected to.\n+\n+\n+Classes\n+=======\n+\n+There are three kinds of pins, differing in what is available for them. They\n+are represented by the below classes. Note that they form a hierarchy, so that\n+each class has all the functionality of the previous class, and adds its own\n+to that.\n+\n+.. note::\n+    Those classes are not actually available for the user, you can't create\n+    new instances of them. You can only use the instaces already provided,\n+    representing the physical pins on your board.\n+\n+.. py:class:: MicroBitDigitalPin\n+\n+    .. py:method:: read_digital()\n+\n+        Return 1 if the pin is high, and 0 if it's low.\n+\n+    .. py:method:: write_digital(value)\n+\n+        Set the pin to high if ``value`` is 1, or to low, if it is 0.\n+\n+.. py:class:: MicroBitAnalogDigitalPin(MicroBitDigitalPin)\n+\n+    .. py:method:: read_analog()\n+\n+        Read the voltage applied to the pin, and return it as an integer\n+        between 0 (meaning 0V) and 1023 (meaning 3.3V).\n+\n+    .. py:method:: write_analog(value)\n+\n+        Output a PWM signal on the pin, with the duty cycle proportional to\n+        the provided ``value``. The ``value`` may be either an integer or a\n+        floating point number between 0 (0% duty cycle) and 1023 (100% duty).\n+\n+    .. py:method:: set_analog_period(period)\n+\n+        Set the period of the PWM signal being output to ``period``.","path":"docs/pin.rst","position":100,"original_position":100,"commit_id":"567a268ce08c21db427b9da8a76ff8a749a6edc3","original_commit_id":"567a268ce08c21db427b9da8a76ff8a749a6edc3","user":{"login":"dpgeorge","id":6187689,"avatar_url":"https://avatars.githubusercontent.com/u/6187689?v=3","gravatar_id":"","url":"https://api.github.com/users/dpgeorge","html_url":"https://github.com/dpgeorge","followers_url":"https://api.github.com/users/dpgeorge/followers","following_url":"https://api.github.com/users/dpgeorge/following{/other_user}","gists_url":"https://api.github.com/users/dpgeorge/gists{/gist_id}","starred_url":"https://api.github.com/users/dpgeorge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpgeorge/subscriptions","organizations_url":"https://api.github.com/users/dpgeorge/orgs","repos_url":"https://api.github.com/users/dpgeorge/repos","events_url":"https://api.github.com/users/dpgeorge/events{/privacy}","received_events_url":"https://api.github.com/users/dpgeorge/received_events","type":"User","site_admin":false},"body":"Unit is milliseconds.  Allowed range is hard to figure out.  It will need testing on actual hardware.","created_at":"2015-11-08T22:42:37Z","updated_at":"2015-11-08T22:42:37Z","html_url":"https://github.com/bbcmicrobit/micropython/pull/85#discussion_r44232008","pull_request_url":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/85","_links":{"self":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/comments/44232008"},"html":{"href":"https://github.com/bbcmicrobit/micropython/pull/85#discussion_r44232008"},"pull_request":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/85"}}},"pull_request":{"url":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/85","id":50058943,"html_url":"https://github.com/bbcmicrobit/micropython/pull/85","diff_url":"https://github.com/bbcmicrobit/micropython/pull/85.diff","patch_url":"https://github.com/bbcmicrobit/micropython/pull/85.patch","issue_url":"https://api.github.com/repos/bbcmicrobit/micropython/issues/85","number":85,"state":"open","locked":false,"title":"Pin docs","user":{"login":"deshipu","id":1181357,"avatar_url":"https://avatars.githubusercontent.com/u/1181357?v=3","gravatar_id":"","url":"https://api.github.com/users/deshipu","html_url":"https://github.com/deshipu","followers_url":"https://api.github.com/users/deshipu/followers","following_url":"https://api.github.com/users/deshipu/following{/other_user}","gists_url":"https://api.github.com/users/deshipu/gists{/gist_id}","starred_url":"https://api.github.com/users/deshipu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deshipu/subscriptions","organizations_url":"https://api.github.com/users/deshipu/orgs","repos_url":"https://api.github.com/users/deshipu/repos","events_url":"https://api.github.com/users/deshipu/events{/privacy}","received_events_url":"https://api.github.com/users/deshipu/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-08T12:10:06Z","updated_at":"2015-11-08T22:42:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f276f385762a122026dd70678cd289682275e9a0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/85/commits","review_comments_url":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/85/comments","review_comment_url":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bbcmicrobit/micropython/issues/85/comments","statuses_url":"https://api.github.com/repos/bbcmicrobit/micropython/statuses/567a268ce08c21db427b9da8a76ff8a749a6edc3","head":{"label":"deshipu:pin-docs","ref":"pin-docs","sha":"567a268ce08c21db427b9da8a76ff8a749a6edc3","user":{"login":"deshipu","id":1181357,"avatar_url":"https://avatars.githubusercontent.com/u/1181357?v=3","gravatar_id":"","url":"https://api.github.com/users/deshipu","html_url":"https://github.com/deshipu","followers_url":"https://api.github.com/users/deshipu/followers","following_url":"https://api.github.com/users/deshipu/following{/other_user}","gists_url":"https://api.github.com/users/deshipu/gists{/gist_id}","starred_url":"https://api.github.com/users/deshipu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deshipu/subscriptions","organizations_url":"https://api.github.com/users/deshipu/orgs","repos_url":"https://api.github.com/users/deshipu/repos","events_url":"https://api.github.com/users/deshipu/events{/privacy}","received_events_url":"https://api.github.com/users/deshipu/received_events","type":"User","site_admin":false},"repo":{"id":44597197,"name":"micropython-1","full_name":"deshipu/micropython-1","owner":{"login":"deshipu","id":1181357,"avatar_url":"https://avatars.githubusercontent.com/u/1181357?v=3","gravatar_id":"","url":"https://api.github.com/users/deshipu","html_url":"https://github.com/deshipu","followers_url":"https://api.github.com/users/deshipu/followers","following_url":"https://api.github.com/users/deshipu/following{/other_user}","gists_url":"https://api.github.com/users/deshipu/gists{/gist_id}","starred_url":"https://api.github.com/users/deshipu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deshipu/subscriptions","organizations_url":"https://api.github.com/users/deshipu/orgs","repos_url":"https://api.github.com/users/deshipu/repos","events_url":"https://api.github.com/users/deshipu/events{/privacy}","received_events_url":"https://api.github.com/users/deshipu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/deshipu/micropython-1","description":"Port of MicroPython for the BBC micro:bit","fork":true,"url":"https://api.github.com/repos/deshipu/micropython-1","forks_url":"https://api.github.com/repos/deshipu/micropython-1/forks","keys_url":"https://api.github.com/repos/deshipu/micropython-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/deshipu/micropython-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/deshipu/micropython-1/teams","hooks_url":"https://api.github.com/repos/deshipu/micropython-1/hooks","issue_events_url":"https://api.github.com/repos/deshipu/micropython-1/issues/events{/number}","events_url":"https://api.github.com/repos/deshipu/micropython-1/events","assignees_url":"https://api.github.com/repos/deshipu/micropython-1/assignees{/user}","branches_url":"https://api.github.com/repos/deshipu/micropython-1/branches{/branch}","tags_url":"https://api.github.com/repos/deshipu/micropython-1/tags","blobs_url":"https://api.github.com/repos/deshipu/micropython-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/deshipu/micropython-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/deshipu/micropython-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/deshipu/micropython-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/deshipu/micropython-1/statuses/{sha}","languages_url":"https://api.github.com/repos/deshipu/micropython-1/languages","stargazers_url":"https://api.github.com/repos/deshipu/micropython-1/stargazers","contributors_url":"https://api.github.com/repos/deshipu/micropython-1/contributors","subscribers_url":"https://api.github.com/repos/deshipu/micropython-1/subscribers","subscription_url":"https://api.github.com/repos/deshipu/micropython-1/subscription","commits_url":"https://api.github.com/repos/deshipu/micropython-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/deshipu/micropython-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/deshipu/micropython-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/deshipu/micropython-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/deshipu/micropython-1/contents/{+path}","compare_url":"https://api.github.com/repos/deshipu/micropython-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/deshipu/micropython-1/merges","archive_url":"https://api.github.com/repos/deshipu/micropython-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/deshipu/micropython-1/downloads","issues_url":"https://api.github.com/repos/deshipu/micropython-1/issues{/number}","pulls_url":"https://api.github.com/repos/deshipu/micropython-1/pulls{/number}","milestones_url":"https://api.github.com/repos/deshipu/micropython-1/milestones{/number}","notifications_url":"https://api.github.com/repos/deshipu/micropython-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/deshipu/micropython-1/labels{/name}","releases_url":"https://api.github.com/repos/deshipu/micropython-1/releases{/id}","created_at":"2015-10-20T09:52:54Z","updated_at":"2015-10-20T09:52:55Z","pushed_at":"2015-11-08T21:50:33Z","git_url":"git://github.com/deshipu/micropython-1.git","ssh_url":"git@github.com:deshipu/micropython-1.git","clone_url":"https://github.com/deshipu/micropython-1.git","svn_url":"https://github.com/deshipu/micropython-1","homepage":"","size":773,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"bbcmicrobit:master","ref":"master","sha":"56a388c3f88fa687e58df64fbcb33db437dd601c","user":{"login":"bbcmicrobit","id":15104236,"avatar_url":"https://avatars.githubusercontent.com/u/15104236?v=3","gravatar_id":"","url":"https://api.github.com/users/bbcmicrobit","html_url":"https://github.com/bbcmicrobit","followers_url":"https://api.github.com/users/bbcmicrobit/followers","following_url":"https://api.github.com/users/bbcmicrobit/following{/other_user}","gists_url":"https://api.github.com/users/bbcmicrobit/gists{/gist_id}","starred_url":"https://api.github.com/users/bbcmicrobit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbcmicrobit/subscriptions","organizations_url":"https://api.github.com/users/bbcmicrobit/orgs","repos_url":"https://api.github.com/users/bbcmicrobit/repos","events_url":"https://api.github.com/users/bbcmicrobit/events{/privacy}","received_events_url":"https://api.github.com/users/bbcmicrobit/received_events","type":"Organization","site_admin":false},"repo":{"id":40358251,"name":"micropython","full_name":"bbcmicrobit/micropython","owner":{"login":"bbcmicrobit","id":15104236,"avatar_url":"https://avatars.githubusercontent.com/u/15104236?v=3","gravatar_id":"","url":"https://api.github.com/users/bbcmicrobit","html_url":"https://github.com/bbcmicrobit","followers_url":"https://api.github.com/users/bbcmicrobit/followers","following_url":"https://api.github.com/users/bbcmicrobit/following{/other_user}","gists_url":"https://api.github.com/users/bbcmicrobit/gists{/gist_id}","starred_url":"https://api.github.com/users/bbcmicrobit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbcmicrobit/subscriptions","organizations_url":"https://api.github.com/users/bbcmicrobit/orgs","repos_url":"https://api.github.com/users/bbcmicrobit/repos","events_url":"https://api.github.com/users/bbcmicrobit/events{/privacy}","received_events_url":"https://api.github.com/users/bbcmicrobit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bbcmicrobit/micropython","description":"Port of MicroPython for the BBC micro:bit","fork":false,"url":"https://api.github.com/repos/bbcmicrobit/micropython","forks_url":"https://api.github.com/repos/bbcmicrobit/micropython/forks","keys_url":"https://api.github.com/repos/bbcmicrobit/micropython/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bbcmicrobit/micropython/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bbcmicrobit/micropython/teams","hooks_url":"https://api.github.com/repos/bbcmicrobit/micropython/hooks","issue_events_url":"https://api.github.com/repos/bbcmicrobit/micropython/issues/events{/number}","events_url":"https://api.github.com/repos/bbcmicrobit/micropython/events","assignees_url":"https://api.github.com/repos/bbcmicrobit/micropython/assignees{/user}","branches_url":"https://api.github.com/repos/bbcmicrobit/micropython/branches{/branch}","tags_url":"https://api.github.com/repos/bbcmicrobit/micropython/tags","blobs_url":"https://api.github.com/repos/bbcmicrobit/micropython/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bbcmicrobit/micropython/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bbcmicrobit/micropython/git/refs{/sha}","trees_url":"https://api.github.com/repos/bbcmicrobit/micropython/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bbcmicrobit/micropython/statuses/{sha}","languages_url":"https://api.github.com/repos/bbcmicrobit/micropython/languages","stargazers_url":"https://api.github.com/repos/bbcmicrobit/micropython/stargazers","contributors_url":"https://api.github.com/repos/bbcmicrobit/micropython/contributors","subscribers_url":"https://api.github.com/repos/bbcmicrobit/micropython/subscribers","subscription_url":"https://api.github.com/repos/bbcmicrobit/micropython/subscription","commits_url":"https://api.github.com/repos/bbcmicrobit/micropython/commits{/sha}","git_commits_url":"https://api.github.com/repos/bbcmicrobit/micropython/git/commits{/sha}","comments_url":"https://api.github.com/repos/bbcmicrobit/micropython/comments{/number}","issue_comment_url":"https://api.github.com/repos/bbcmicrobit/micropython/issues/comments{/number}","contents_url":"https://api.github.com/repos/bbcmicrobit/micropython/contents/{+path}","compare_url":"https://api.github.com/repos/bbcmicrobit/micropython/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bbcmicrobit/micropython/merges","archive_url":"https://api.github.com/repos/bbcmicrobit/micropython/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bbcmicrobit/micropython/downloads","issues_url":"https://api.github.com/repos/bbcmicrobit/micropython/issues{/number}","pulls_url":"https://api.github.com/repos/bbcmicrobit/micropython/pulls{/number}","milestones_url":"https://api.github.com/repos/bbcmicrobit/micropython/milestones{/number}","notifications_url":"https://api.github.com/repos/bbcmicrobit/micropython/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bbcmicrobit/micropython/labels{/name}","releases_url":"https://api.github.com/repos/bbcmicrobit/micropython/releases{/id}","created_at":"2015-08-07T11:58:53Z","updated_at":"2015-11-08T14:11:37Z","pushed_at":"2015-11-08T21:50:48Z","git_url":"git://github.com/bbcmicrobit/micropython.git","ssh_url":"git@github.com:bbcmicrobit/micropython.git","clone_url":"https://github.com/bbcmicrobit/micropython.git","svn_url":"https://github.com/bbcmicrobit/micropython","homepage":"","size":12859,"stargazers_count":97,"watchers_count":97,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":33,"forks":13,"open_issues":33,"watchers":97,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/85"},"html":{"href":"https://github.com/bbcmicrobit/micropython/pull/85"},"issue":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/issues/85"},"comments":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/issues/85/comments"},"review_comments":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/85/comments"},"review_comment":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/85/commits"},"statuses":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/statuses/567a268ce08c21db427b9da8a76ff8a749a6edc3"}}}}