API Reference
pixel_mapper
Pixel Mapper for Adafruit_CircuitPython_LED_Animation
Author(s): Ben Robinson
Implementation Notes
Hardware:
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://circuitpython.org/downloads
- pixel_mapper.horizontal_stacked_panels_mapper(width, height, panel_width=8, alternating=True, reverse=False, x_offset=0, y_offset=0)
Maps (x, y) to index in a display made of horizontally stacked panels, each snaking vertically in columns, with panels laid left to right.
- Parameters:
width – Full matrix width (e.g., 32)
height – Full matrix height (e.g., 16)
panel_width – Width of each panel (default: 8)
alternating – Whether to alternate columns up/down
reverse – If True, panels are ordered right-to-left
x_offset – Offset for x coordinate
y_offset – Offset for y coordinate
- Returns:
mapper(x, y) function
- Raises:
ValueError – If x or y coordinates are out of bounds
- pixel_mapper.vertical_stacked_panels_mapper(width, height, panel_height=8, alternating=True, reverse=False, x_offset=0, y_offset=0)
Maps (x, y) to index in a display made of vertically stacked 32x8 panels, each snaking vertically up and down, with panels stacked top-to-bottom.
- Parameters:
width – Full grid width (e.g., 32)
height – Full grid height (e.g., 32)
panel_height – Height of each panel
alternating – Whether to alternate rows up/down
reverse – If True, panels are ordered bottom-to-top
x_offset – Offset for x coordinate
y_offset – Offset for y coordinate
- Returns:
mapper(x, y) function
- Raises:
ValueError – If x or y coordinates are out of bounds