I will try to approach from the other end.
Could anyone suggest micropython oled library which supports custom font and have some way to determine string/character width?
Search found 7 matches
- Wed Jul 20, 2022 1:48 pm
- Forum: Hardware Projects
- Topic: Font width for OLED?
- Replies: 9
- Views: 34089
- Wed Jul 20, 2022 9:30 am
- Forum: Hardware Projects
- Topic: Font width for OLED?
- Replies: 9
- Views: 34089
Re: Font width for OLED?
No, it seems to be a different library. Where did you get it from? And what is the result of: dir(oled.ubuntu_mono_15) ? I followed https://espresso-ide.readthedocs.io/projects/micropython-oled/en/latest/content/getting_started.html I just used upip.install("micropython-oled"). >>> dir(oled.ubuntu_...
- Wed Jul 20, 2022 9:16 am
- Forum: Hardware Projects
- Topic: Font width for OLED?
- Replies: 9
- Views: 34089
Re: Font width for OLED?
import oled dir(oled) >>> import oled >>> dir(oled) ['__class__', '__name__', 'write', '__file__', '__path__', 'I2C', 'Pin', 'framebuf', 'time', 'gfx', 'ssd1306', 'lazy', 'fonts', 'GFX', 'SET_CONTRAST', 'SET_ENTIRE_ON', 'SET_NORM_INV', 'SET_DISP', 'SET_MEM_ADDR', 'SET_COL_ADDR', 'SET_PAGE_ADDR', 'S...
- Wed Jul 20, 2022 8:40 am
- Forum: Hardware Projects
- Topic: Font width for OLED?
- Replies: 9
- Views: 34089
Re: Font width for OLED?
The font is a fixed-size and there's no automatic line breaking. So the length of the text is always len(text)*8. So the library is using other way, because I clearly see the difference between ubuntu 15 and 20. With 20 only 13 characters fit in 128pixel OLED. With 15 more than 18 characters. Any i...
- Tue Jul 19, 2022 9:33 pm
- Forum: Hardware Projects
- Topic: Font width for OLED?
- Replies: 9
- Views: 34089
Font width for OLED?
Hello, I am trying to implement text scroll for long text lines on OLED display. To do that, I need to determine the width of the given text. I am using the following library and fonts import upip upip.install("micropython-oled") from oled import Write, SSD1306_I2C from oled.fonts import ubuntu_mono...
- Fri Jul 15, 2022 4:05 pm
- Forum: Raspberry Pi microcontroller boards
- Topic: Pin as string doesn't work
- Replies: 3
- Views: 3270
- Tue Jul 12, 2022 6:05 pm
- Forum: Raspberry Pi microcontroller boards
- Topic: Pin as string doesn't work
- Replies: 3
- Views: 3270
Pin as string doesn't work
Hello, I have Raspberry Pi Pico W with: Python version 3.4.0; MicroPython v1.19.1 on 2022-06-18 Version info. (3, 4, 0) When I am trying to run the following: from machine import Pin led = Pin( "LED", Pin.OUT ) led.on() led.off() I get an error: Traceback (most recent call last): File "<stdin>", lin...