diff options
author | Damien George <damien.p.george@gmail.com> | 2016-12-08 15:17:47 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-12-08 15:17:47 +1100 |
commit | 898d4c1217e69497c67ca2ddb66641406a03700b (patch) | |
tree | bd55f50770afc479238181c7ca6307cd387a3882 /tests/extmod/framebuf1.py | |
parent | ad166857bc93e519bca8c4f14523dcce654a5994 (diff) | |
download | micropython-898d4c1217e69497c67ca2ddb66641406a03700b.tar.gz micropython-898d4c1217e69497c67ca2ddb66641406a03700b.zip |
extmod/modframebuf: Make framebuf implement the buffer protocol.
So that one can easily access the underlying data of the frame buffer, eg
to write the data out to a display.
Diffstat (limited to 'tests/extmod/framebuf1.py')
-rw-r--r-- | tests/extmod/framebuf1.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/extmod/framebuf1.py b/tests/extmod/framebuf1.py index 7be3655284..7f09050b04 100644 --- a/tests/extmod/framebuf1.py +++ b/tests/extmod/framebuf1.py @@ -10,6 +10,9 @@ h = 16 buf = bytearray(w * h // 8) fbuf = framebuf.FrameBuffer(buf, w, h, framebuf.MVLSB) +# access as buffer +print(memoryview(fbuf)[0]) + # fill fbuf.fill(1) print(buf) |