Page 1 of 2

"framebuf" module??????

Posted: Wed Nov 23, 2016 7:00 am
by synimak
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.

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

Posted: Thu Nov 24, 2016 9:08 am
by pythoncoder
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

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

Posted: Fri Nov 25, 2016 4:37 am
by synimak
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?

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

Posted: Fri Nov 25, 2016 9:18 am
by pythoncoder
It's the only reason I can think of.

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

Posted: Mon Dec 05, 2016 3:15 am
by kamikaze
is there any chance it will appear in the docs? :roll:

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

Posted: Mon Dec 05, 2016 7:35 am
by pythoncoder
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.

"framebuf" module

Posted: Sun Jan 01, 2017 4:30 am
by kamikaze
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

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

Posted: Mon Jan 02, 2017 4:28 am
by kamikaze
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?

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

Posted: Mon Jan 02, 2017 9:07 am
by pythoncoder
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.

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

Posted: Mon Jan 02, 2017 12:56 pm
by kamikaze
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)