Pimoroni MicroPython - Unicorn Pack PyCharm (or other IDE) stubs

Thu, 28 January 2021

__init__.py
# Add this file into a python package directory called `picounicorn`

BUTTON_A = 0  # type: int
BUTTON_B = 1  # type: int
BUTTON_X = 2  # type: int
BUTTON_Y = 3  # type: int


def init():
    """
    Sets up Pico Unicorn. `init` must be called before any other functions since it configures
    the PIO and require GPIO inputs. Just call `init()` like so:
    """
    pass


def set_pixel(x, y, r, g, b):
    """
    Sets an RGB LED on Pico Unicorn with an RGB triplet.
    Uses hardware PWM to drive the LED. Values are automatically gamma-corrected to provide
    smooth brightness transitions and low values may map as "off."
    :param int x:
    :param int y:
    :param int r:
    :param int g:
    :param int b:
    """
    pass


def set_pixel_value(x, y, v):
    """
    Sets all elements of an RGB LED on Pico Unicorn to a single value.
    This lights an LED up white at varying intensity and is useful if you want to pretend
    Pico Unicorn is a monochrome display.
    :param int x:
    :param int y:
    :param int v:
    """
    pass


def is_pressed(button):
    """
    Reads the GPIO pin connected to one of Pico Unicorn's buttons, returning True if it's
    pressed and False if it is released.
    The button value should be a number denoting a pin, and constants picounicorn.BUTTON_A,
    picounicorn.BUTTON_B, picounicorn.BUTTON_X and picounicorn.BUTTON_Y are supplied to make it easier. e:
    :param button:
    :rtype: bool
    """
    pass


def get_width():
    """
    Get the width of the Pico Unicorn display:
    :rtype: int
    """
    pass


def get_height():
    """
    Get the height of the Pico Unicorn display
    :rtype: int
    """
    pass