From: Melissa LeBlanc-Williams Date: Thu, 15 Jul 2021 18:55:57 +0000 (-0700) Subject: Merge branch 'u2if' of https://github.com/lesamouraipourpre/Adafruit_Blinka into... X-Git-Tag: 6.11.1^2 X-Git-Url: https://git.ayoreis.com/Adafruit_Blinka-hackapet.git/commitdiff_plain/fa5afb5e90e6fa672ce2b9af3c7b8cf7a58b34c6?hp=8f9c6b751545645305baba05d8c6260b18f07d68 Merge branch 'u2if' of https://github.com/lesamouraipourpre/Adafruit_Blinka into u2if --- diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f00cbfe..95bdea1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,7 +35,7 @@ jobs: source actions-ci/install.sh - name: Pip install pylint, black, & Sphinx run: | - pip install --force-reinstall pylint black Sphinx sphinx-rtd-theme + pip install --force-reinstall pylint==2.7.1 black Sphinx sphinx-rtd-theme - name: Library version run: git describe --dirty --always --tags - name: Check formatting diff --git a/setup.py b/setup.py index 5d6ea95..576afbd 100755 --- a/setup.py +++ b/setup.py @@ -57,6 +57,7 @@ setup( "pulseio", "pwmio", "neopixel_write", + "rainbowio", ], package_data={ "adafruit_blinka.microcontroller.bcm283x.pulseio": ["libgpiod_pulsein"] diff --git a/src/adafruit_blinka/microcontroller/bcm283x/pulseio/PulseIn.py b/src/adafruit_blinka/microcontroller/bcm283x/pulseio/PulseIn.py index fd9febe..19dc98f 100644 --- a/src/adafruit_blinka/microcontroller/bcm283x/pulseio/PulseIn.py +++ b/src/adafruit_blinka/microcontroller/bcm283x/pulseio/PulseIn.py @@ -25,7 +25,7 @@ def final(): atexit.register(final) -# pylint: disable=c-extension-no-member, consider-using-with +# pylint: disable=c-extension-no-member class PulseIn: """PulseIn Class to read PWM signals""" diff --git a/src/adafruit_blinka/microcontroller/tegra/t186/pin.py b/src/adafruit_blinka/microcontroller/tegra/t186/pin.py index f728a40..2191c26 100644 --- a/src/adafruit_blinka/microcontroller/tegra/t186/pin.py +++ b/src/adafruit_blinka/microcontroller/tegra/t186/pin.py @@ -94,7 +94,7 @@ I05 = Pin("GPIO_PQ5") T03 = Pin("UART1_CTS") T02 = Pin("UART1_RTS") P17 = Pin("GPIO_EXP_P17") -AA00 = Pin("CAN0_GPIO0") +AA00 = Pin("CAN_GPIO0") Y01 = Pin("GPIO_MDM2") P16 = Pin("GPIO_EXP_P16") I04 = Pin("GPIO_PQ4") diff --git a/src/busio.py b/src/busio.py index 3057e52..b41b4c4 100755 --- a/src/busio.py +++ b/src/busio.py @@ -18,7 +18,7 @@ from adafruit_blinka import Enum, Lockable, agnostic from adafruit_blinka.agnostic import board_id, detector # pylint: disable=import-outside-toplevel,too-many-branches,too-many-statements -# pylint: disable=too-many-arguments,too-many-function-args,consider-using-with,too-many-return-statements +# pylint: disable=too-many-arguments,too-many-function-args,too-many-return-statements class I2C(Lockable): diff --git a/src/rainbowio.py b/src/rainbowio.py new file mode 100644 index 0000000..e852d83 --- /dev/null +++ b/src/rainbowio.py @@ -0,0 +1,27 @@ +""" +`rainbowio` - Provides the `colorwheel()` function +=========================================================== +See `CircuitPython:rainbowio` in CircuitPython for more details. +Not supported by all boards. + +* Author(s): Kattni Rembor +""" + + +def colorwheel(color_value): + """ + A colorwheel. ``0`` and ``255`` are red, ``85`` is green, and ``170`` is blue, with the values + between being the rest of the rainbow. + + :param int color_value: 0-255 of color value to return + :return: tuple of RGB values + """ + if color_value < 0 or color_value > 255: + return 0, 0, 0 + if color_value < 85: + return 255 - color_value * 3, color_value * 3, 0 + if color_value < 170: + color_value -= 85 + return 0, 255 - color_value * 3, color_value * 3 + color_value -= 170 + return color_value * 3, 0, 255 - color_value * 3