Skip to content

Commit 2e11cac

Browse files
committed
Added better documentation, example improvement
1 parent 48f8a95 commit 2e11cac

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

adafruit_pixel_framebuf.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,18 @@ class PixelFramebuffer(adafruit_framebuf.FrameBuffer):
5454
"""
5555
NeoPixel and Dotstar FrameBuffer for easy drawing and text on a
5656
grid of either kind of pixel
57+
58+
:param strip: An object that implements the Neopixel or Dotstar protocol.
59+
:param width: Framebuffer width.
60+
:param height: Framebuffer height.
61+
:param orientation: Orientation of the strip pixels - HORIZONTAL (default) or VERTICAL.
62+
:param alternating: Whether the strip alternates direction from row to row (default True).
63+
:param reverse_x: Whether the strip X origin is on the right side (default False).
64+
:param reverse_y: Whether the strip Y origin is on the bottom (default False).
65+
:param tuple top: (x, y) coordinates of grid top left corner (Optional)
66+
:param tuple bottom: (x, y) coordinates of grid bottom right corner (Optional)
67+
:param int rotation: A value of 0-3 representing the rotation of the framebuffer (default 0)
68+
5769
"""
5870

5971
def __init__(
@@ -96,7 +108,7 @@ def blit(self):
96108
raise NotImplementedError()
97109

98110
def display(self):
99-
"""Copy the raw buffer to the grid and show"""
111+
"""Copy the raw buffer changes to the grid and show"""
100112
for _y in range(self._height):
101113
for _x in range(self._width):
102114
index = (_y * self.stride + _x) * 3

examples/pixel_framebuf_16x16_animation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
pixel_framebuf.line(0, 0, pixel_width - 1, pixel_height - 1, 0x00FF00)
2424
pixel_framebuf.line(0, pixel_width - 1, pixel_height - 1, 0, 0x00FF00)
2525
pixel_framebuf.fill_rect(2, 3, 12, 10, 0x000000)
26-
pixel_framebuf.text(text, 16 - i, 4, 0xFFFF00)
26+
pixel_framebuf.text(text, pixel_width - i, 4, 0xFFFF00)
2727
pixel_framebuf.rect(1, 2, 14, 12, 0xFF0000)
2828
pixel_framebuf.line(0, 2, 0, 14, 0x000088)
2929
pixel_framebuf.line(pixel_width - 1, 2, pixel_width - 1, 14, 0x000088)

0 commit comments

Comments
 (0)