From f913f3198b32d5079549777bfd961b9a4df89935 Mon Sep 17 00:00:00 2001 From: James Sutton <1068763+jpwsutton@users.noreply.github.com> Date: Fri, 22 Jan 2021 23:05:23 +0000 Subject: [PATCH] Fixing buffer in picodisplay micropython example Signed-off-by: James Sutton <1068763+jpwsutton@users.noreply.github.com> --- micropython/examples/pico_display/demo.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/micropython/examples/pico_display/demo.py b/micropython/examples/pico_display/demo.py index 9236d0b3..48fd7698 100644 --- a/micropython/examples/pico_display/demo.py +++ b/micropython/examples/pico_display/demo.py @@ -1,6 +1,11 @@ import time, random -import picodisplay as display -display.init() +import picodisplay as display + +WIDTH = 240 +HEIGHT = 135 + +display_buffer = bytearray(WIDTH * HEIGHT) +display.init(display_buffer) display.set_backlight(1.0) i = 0 width = display.get_width()