Font size increase for OLED Display Module SSD1306

Hey Allan,

Just wanted to touch base really quickly - where were you up to with this?(the thought of doing this work twice would be painful)
I’ve got a project where I would also like to use some larger numbers and thought of spinning up a could of small functions to draw specific characters like you requested:

I’ll keep you posted :smiley:

Bumping the topic: while the excellent team at Core works on a cleaner implementation I’ve botched together something that allows for scaling much like parametric CAD.

2 Likes

Thanks very much putting that code together. After a bit of thought, I’m more inclined to work with…

I have no idea how font files work, but I can easily generate text files like the following (for example) “5.DAT”
image

If I have a temperature (say) “+12.34C” I can:

FOR each line
FOR each characters in the string,
call up the appropriate character “.DAT” file and
FOR each line/column in the DAT file, with the appropriate character offset, set the relevant pixels in the frame buffer.
RINSE and REPEAT

[incidentally, How do you indent text in this forum?]

The key element is:

Not too fussed about the speed because it’s a temperature reading which should be varying only slowly (in my case anyway), and we do a screen update only when the entire process is finished. Not particularly elegant either, but it’s simple. Fault finding is relatively straightforward. And updates/correction/alternatives to the font/DAT files can be done with a text editor. Or in my case an Excel spreadsheet using conditional formatting to manually construct DAT file source data for each character.

The hold-up is that I have no idea how to open a file and read the data in micro-python. And zero experience using a Pi . I’m working on it.

In the meantime, if someone wants to put some code together, I’m quite happy to generate the DAT files…

Cheers,
ALH

1 Like

Hi Allan,

The blit method (mentioned in the Factory) more or less does the overlaying method, though is only included in framebuf.

In Micropython the font is stored as a long hex array: micropython/font_petme128_8x8.h at master · micropython/micropython · GitHub
This tool lets you build, visualise and text hex strings: LED Matrix Tool

Though the underlying code isn’t there to scale and load the fonts.

Id definitely check out a guide on using file readers, the Makerverse micro SD adapter. Makerverse Micro SD Adapter - MicroPython Guide and Data Logging - Tutorial Australia

I’m not entirely certain that its possible, the forum’s text input uses markdown so you can bullet items with - or * but screenshots are probably easier (or comment them like code with ``` at the start and end

Thanks of those links. This may take a while. Now might be a good time to learn some basic linux skills.
ALH

An interesting discussion.
The bitmap and line drawing methods I used are very limited, but they resulted in a quick solution and low memory usage. When I first started I wanted to develop a font driver, the ability to use existing font files to display characters. I soon found it was beyond my programming skills.

The RPi Pico has a limited memory which is already half used by Micro Python. Adafruits version takes up even more memory space. The RP2040 can support up to 16MB of off chip memory, the Pico has only 2MB. Price, space consideration ??? If version 2 of the Pico is ever produced I would like to see it with the full 16MB.

The PiicoDev OLED module is a great product, I have yet to use it on anything other than the Pico. I am pretty sure a RPi Zero 2 would be able to run scalable fonts. I have done this with an Adafruit OLED and their drivers.

An alternative using the Pico would be to throwaway Micropython and use the Arduino IDE to develop C++ code. I soon gave up this idea because Thonny and Micropython are just too easy to use.

Some thoughts.
Cheers
Jim

1 Like