]> Repositories - Adafruit_Blinka-hackapet.git/commitdiff
Merge pull request #511 from lesamouraipourpre/examples
authorMelissa LeBlanc-Williams <melissa@adafruit.com>
Tue, 21 Sep 2021 17:41:22 +0000 (10:41 -0700)
committerGitHub <noreply@github.com>
Tue, 21 Sep 2021 17:41:22 +0000 (10:41 -0700)
Document the examples

16 files changed:
.github/workflows/release.yml
README.rst
docs/api.rst
setup.py
src/analogio.py
src/bitbangio.py
src/board.py
src/busio.py
src/digitalio.py
src/keypad.py
src/microcontroller/__init__.py
src/micropython.py
src/neopixel_write.py
src/pulseio.py
src/pwmio.py
src/rainbowio.py

index ce2635bceb9081de638d04215f237444feba87c4..220e398e34de24d56a97bf359af1acb40c0c53dd 100644 (file)
@@ -29,8 +29,5 @@ jobs:
         TWINE_USERNAME: ${{ secrets.pypi_username }}
         TWINE_PASSWORD: ${{ secrets.pypi_password }}
       run: |
-        for file in $(find -not -path "./.*" -not -path "./docs*" -name "*.py"); do
-            sed -i -e "s/0.0.0-auto.0/${{github.event.release.tag_name}}/" $file;
-        done;
         python setup.py sdist
         twine upload dist/*
index d802c16077e6b17398021eaff1ec27229c9f0bf0..8f3aa290927d82c1ad7bb809e84730f2e92c40c8 100755 (executable)
@@ -25,11 +25,13 @@ for devices or hosts running CPython or MicroPython. Working code exists to emul
 * **board** - breakout-specific pin identities
 * **busio** - hardware-driven interfaces for I2C, SPI, UART
 * **digitalio** - digital input/output pins, using pin identities from board+microcontroller packages
+* **keypad** - support for scanning keys and key matrices
 * **microcontroller** - chip-specific pin identities
 * **micropython** - MicroPython-specific module
 * **neopixel_write** - low-level interface to NeoPixels
 * **pulseio** - contains classes that provide access to basic pulse IO (PWM)
 * **pwmio** - contains classes that provide access to basic pulse IO (PWM)
+* **rainbowio** - provides the colorwheel() function
 
 For details, see the `Blinka API reference
 <https://circuitpython.readthedocs.io/projects/blinka/en/latest/index.html>`_.
index 61e9bbee5fc477d73425faa0a99dea71c333b0fb..dc0aeb6e660b85d9b152de70d174266abc4efbde 100755 (executable)
@@ -13,6 +13,9 @@
 .. automodule:: adafruit_blinka.microcontroller
   :members:
 
+.. automodule:: analogio
+  :members:
+
 .. automodule:: bitbangio
   :members:
 
 .. automodule:: digitalio
   :members:
 
-.. automodule:: analogio
+.. automodule:: keypad
   :members:
 
-.. automodule:: pulseio
+.. automodule:: microcontroller
+  :members:
+
+.. automodule:: micropython
   :members:
 
 .. automodule:: neopixel_write
   :members:
 
+.. automodule:: pulseio
+  :members:
+
+.. automodule:: pwmio
+  :members:
 
+.. automodule:: rainbowio
+  :members:
index a18904c1d46871640d8b45be7acc970724866e0f..576afbdca29645bfa187c37de958fbae7b3b6e70 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -34,11 +34,7 @@ if os.path.exists("/proc/device-tree/compatible"):
 
 setup(
     name="Adafruit-Blinka",
-    use_scm_version={
-        # This is needed for the PyPI version munging in the Github Actions release.yml
-        "git_describe_command": "git describe --tags --long",
-        "local_scheme": "no-local-version",
-    },
+    use_scm_version=True,
     setup_requires=["setuptools_scm"],
     description="CircuitPython APIs for non-CircuitPython versions of Python such as CPython on Linux and MicroPython.",
     long_description=long_description,
@@ -57,11 +53,10 @@ setup(
         "board",
         "busio",
         "digitalio",
-        "keypad",
         "micropython",
-        "neopixel_write",
         "pulseio",
         "pwmio",
+        "neopixel_write",
         "rainbowio",
     ],
     package_data={
index 6d5821a2a1052b4cd2dec2f704fab44ed9e032e2..0016505a21d54030f35e68ffa980dbbbd7446b51 100644 (file)
@@ -7,11 +7,6 @@ Not supported by all boards.
 * Author(s): Carter Nelson, Melissa LeBlanc-Williams
 """
 
-
-__version__ = "0.0.0-auto.0"
-__repo__ = "https://github.com/adafruit/Adafruit_Blinka.git"
-
-
 import sys
 
 from adafruit_blinka.agnostic import detector
index e63168fbbf0484e96b6d99acb1474bc2a6a2dab9..d13b743a4a5f44c573be0ec9e1ad7db6b810a84b 100755 (executable)
@@ -7,11 +7,6 @@ See `CircuitPython:bitbangio` in CircuitPython for more details.
 * Author(s): cefn
 """
 
-
-__version__ = "0.0.0-auto.0"
-__repo__ = "https://github.com/adafruit/Adafruit_Blinka.git"
-
-
 import adafruit_platformdetect.constants.boards as ap_board
 from adafruit_blinka import Lockable, agnostic
 
index 0de6c109f5a8147ec75c4af5aa4bd4b4454abd3b..af73c13de17e72d0ce2c96073b3735f11aa7e198 100755 (executable)
@@ -27,13 +27,6 @@ See `CircuitPython:board` in CircuitPython for more details.
 
 * Author(s): cefn
 """
-
-
-__version__ = "0.0.0-auto.0"
-__repo__ = "https://github.com/adafruit/Adafruit_Blinka.git"
-__blinka__ = True
-
-
 import sys
 
 import adafruit_platformdetect.constants.boards as ap_board
index ea415162248749d369bd11e426e0a655c2bb2e2b..46d0f9ba90cdcf81f6da910ede1c5cafcefaa99e 100755 (executable)
@@ -7,11 +7,6 @@ See `CircuitPython:busio` in CircuitPython for more details.
 * Author(s): cefn
 """
 
-
-__version__ = "0.0.0-auto.0"
-__repo__ = "https://github.com/adafruit/Adafruit_Blinka.git"
-
-
 try:
     import threading
 except ImportError:
index 2df60818794620f15a036cf44bead2bb5e72b35f..ad05cb30dc9ac6b731d58f44fe1481f0ebde808d 100755 (executable)
@@ -7,11 +7,6 @@ See `CircuitPython:digitalio` in CircuitPython for more details.
 * Author(s): cefn
 """
 
-
-__version__ = "0.0.0-auto.0"
-__repo__ = "https://github.com/adafruit/Adafruit_Blinka.git"
-
-
 from adafruit_blinka.agnostic import board_id, detector
 
 # pylint: disable=ungrouped-imports,wrong-import-position
index 0dd05e93b5b62131aff6eee80fb2dc88be75fd31..a156d6e5add4fd0b951ca880d5e33b3618811292 100644 (file)
@@ -6,11 +6,6 @@ See `CircuitPython:keypad` in CircuitPython for more details.
 * Author(s): Melissa LeBlanc-Williams
 """
 
-
-__version__ = "0.0.0-auto.0"
-__repo__ = "https://github.com/adafruit/Adafruit_Blinka.git"
-
-
 import time
 import threading
 from collections import deque
@@ -467,7 +462,7 @@ class ShiftRegisterKeys(_KeysBase):
 
     @property
     def events(self):
-        """The `EventQueue` associated with this `Keys` object. (read-only)"""
+        """The ``EventQueue`` associated with this `Keys` object. (read-only)"""
         return self._events
 
     def _keypad_shiftregisterkeys_scan(self):
index 9e05c81045ea5d1e9485ce6f47ba82ebdbd2adea..fda16cc109c9c1d7c9409e89b2cbe36c4efa10b0 100755 (executable)
@@ -1,4 +1,9 @@
-"""Microcontroller pins"""
+"""
+`microcontroller` - Pin references and cpu functionality
+========================================================
+
+* Author(s): Melissa LeBlanc-Williams
+"""
 
 import sys
 import time
@@ -14,7 +19,12 @@ def delay_us(delay):
 
 
 class Pin(Enum):
-    """Reference Pin object"""
+    """
+    Identifies an IO pin on the microcontroller.
+
+    They are fixed by the hardware so they cannot be constructed on demand. Instead, use board or
+    microcontroller.pin to reference the desired pin.
+    """
 
     def __init__(self, pin_id):
         """Identifier for pin, referencing platform-specific pin id"""
index 62698c8d06a5c0b34a0e277850ae1a68d88d12b8..843d5a5704f0b517b5064dca524d011e7951b4ca 100755 (executable)
@@ -1,15 +1,11 @@
 """
 `micropython` - MicroPython Specific Decorator Functions
-=================================================
+========================================================
 
 * Author(s): cefn
 """
 
 
-__version__ = "0.0.0-auto.0"
-__repo__ = "https://github.com/adafruit/Adafruit_Blinka.git"
-
-
 def const(x):
     "Emulate making a constant"
     return x
index 953a36577f585c80708077e00e9683044bb9080f..2097c84915b5fad24edb02884e816a9286388bbc 100644 (file)
@@ -8,11 +8,6 @@ Currently supported on Raspberry Pi only.
 * Author(s): ladyada
 """
 
-
-__version__ = "0.0.0-auto.0"
-__repo__ = "https://github.com/adafruit/Adafruit_Blinka.git"
-
-
 import sys
 
 from adafruit_blinka.agnostic import detector
index c12d1890876502fb70416912184e3e9f2e029d1b..dc20e3dc029ab97207794897584b41925fa1b4f6 100644 (file)
@@ -7,11 +7,6 @@ Not supported by all boards.
 * Author(s): Melissa LeBlanc-Williams
 """
 
-
-__version__ = "0.0.0-auto.0"
-__repo__ = "https://github.com/adafruit/Adafruit_Blinka.git"
-
-
 import sys
 
 from adafruit_blinka.agnostic import detector
index 4299f54678d85cbfd22180ad9645a7383e2b9fb6..f59805852b52d95d3f67033a36ac9764dba6c33c 100644 (file)
@@ -7,11 +7,6 @@ Not supported by all boards.
 * Author(s): Melissa LeBlanc-Williams
 """
 
-
-__version__ = "0.0.0-auto.0"
-__repo__ = "https://github.com/adafruit/Adafruit_Blinka.git"
-
-
 import sys
 
 from adafruit_blinka.agnostic import detector
index b7bc06a8110b558e29d4c534ed1322d1c9fbd693..e852d83d9003cb61e04dde01443571083e0d8905 100644 (file)
@@ -8,10 +8,6 @@ Not supported by all boards.
 """
 
 
-__version__ = "0.0.0-auto.0"
-__repo__ = "https://github.com/adafruit/Adafruit_Blinka.git"
-
-
 def colorwheel(color_value):
     """
     A colorwheel. ``0`` and ``255`` are red, ``85`` is green, and ``170`` is blue, with the values