"framebuf" module??????

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
synimak
Posts: 20
Joined: Sun Feb 28, 2016 5:11 am
Contact:

"framebuf" module??????

Post by synimak » Wed Nov 23, 2016 7:00 am

Where can I find the "framebuf" module for running the FeatherWing OLED - 128x32 OLED??? I've been looking everywhere but can't find it. I am looking at running it on the pyBoard v1.1.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: "framebuf" module??????

Post by pythoncoder » Thu Nov 24, 2016 9:08 am

It should be part of the standard firmware build. The following works on a Pyboard and a Feather Huzzah:

Code: Select all

>>> import framebuf
>>> dir(framebuf)
['__name__', 'FrameBuffer1']
>>>
If you want to inspect the C source it's in extmod/modframebuf.c
Peter Hinch
Index to my micropython libraries.

synimak
Posts: 20
Joined: Sun Feb 28, 2016 5:11 am
Contact:

Re: "framebuf" module??????

Post by synimak » Fri Nov 25, 2016 4:37 am

I am still running firmware version 1.3 haven't got around to updating it(Been having trouble uploading new fw). Guessing that could be the issue?

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: "framebuf" module??????

Post by pythoncoder » Fri Nov 25, 2016 9:18 am

It's the only reason I can think of.
Peter Hinch
Index to my micropython libraries.

User avatar
kamikaze
Posts: 154
Joined: Tue Aug 16, 2016 10:10 am
Location: Latvia
Contact:

Re: "framebuf" module??????

Post by kamikaze » Mon Dec 05, 2016 3:15 am

is there any chance it will appear in the docs? :roll:

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: "framebuf" module??????

Post by pythoncoder » Mon Dec 05, 2016 7:35 am

The framebuf module is under active development so docs may not be forthcoming just yet. You might want to search the forum for sample code. I can think of two sources: the official ssd1306 driver https://github.com/micropython/micropyt ... ssd1306.py and the work @marfis has done on the Limifrog http://forum.micropython.org/viewtopic.php?f=12&t=2736.
Peter Hinch
Index to my micropython libraries.

User avatar
kamikaze
Posts: 154
Joined: Tue Aug 16, 2016 10:10 am
Location: Latvia
Contact:

"framebuf" module

Post by kamikaze » Sun Jan 01, 2017 4:30 am

Here I'm trying to output text onto SSD1322 display. So I've modified modframebuf.c to have GRAY4 (not sure how it is correct to call) mode.

https://www.youtube.com/watch?v=ypfTRDImBR8

User avatar
kamikaze
Posts: 154
Joined: Tue Aug 16, 2016 10:10 am
Location: Latvia
Contact:

Re: "framebuf" module??????

Post by kamikaze » Mon Jan 02, 2017 4:28 am

Implemented fill_rect too: https://www.youtube.com/watch?v=zfceKS-Bizk

There is a little bug remaining. After fixing it - is it possible to make THIS merged into master?

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: "framebuf" module??????

Post by pythoncoder » Mon Jan 02, 2017 9:07 am

I'm not sure if you're familiar with the procedure - you need to submit a PR (pull request). The maintainers will review it in due course. Once a patch is agreed they will incorporate it. I suggest you look at the developer docs including https://github.com/micropython/micropyt ... ENTIONS.md and the dev wiki https://github.com/micropython/micropython/wiki.

I've not looked at your code in detail but the maintainers may not like your changes to variable names. The choice of the English rather than American spelling of "colour" was deliberate.
Peter Hinch
Index to my micropython libraries.

User avatar
kamikaze
Posts: 154
Joined: Tue Aug 16, 2016 10:10 am
Location: Latvia
Contact:

Re: "framebuf" module??????

Post by kamikaze » Mon Jan 02, 2017 12:56 pm

pythoncoder wrote:maintainers may not like your changes to variable names. The choice of the English rather than American spelling of "colour" was deliberate.
I'm wondering why they did accepted situation when there are three kinds of naming it: "col", "color" and "colour" within 20 lines o_O I've just tried to make it same. Also I've seen "color" almost everywhere when it appeared (in other projects)

Post Reply