Skip to content

Commit

Permalink
Add example pin usage to pin documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ntoll committed Feb 12, 2016
1 parent faaba30 commit 240c617
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/pin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ The pins are your board's way to communicate with external devices connected to
it. There are 19 pins for your disposal, numbered 0-16 and 19-20. Pins 17 and
18 are not available.

For example, the script below will change the display on the micro:bit
depending upon the digital reading on pin 0::

from microbit import *


while True:
if pin0.read_digital():
display.show(Image.HAPPY)
else:
display.show(Image.SAD)


Pin Functions
=============
Expand Down

0 comments on commit 240c617

Please sign in to comment.