<commit_before>Input/Output Pins
*****************

.. py:module:: microbit

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.


Pin Functions
=============<commit_msg>Add example pin usage to pin documentation.<commit_after>Input/Output Pins
*****************

.. py:module:: microbit

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
=============
{'fraction_non_alphanumeric': 0.12307692307692308, 'fraction_numerical': 0.03076923076923077, 'mean_word_length': 3.555, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4386299', 'n_tokens_mistral': 279, 'n_tokens_neox': 237, 'n_words': 112}