luisgabrielroldan
Hi community!
This is my first post in the forum! (Hope I’m doing it well
)
I want to share with you a project I’ve been working since a couple of weeks.
Some months ago I started to work on a driver for OLED displays based on SSD1306 (very popular and cheap!). It worked, had some primitives to draw points and lines… but that’s not quite useful.
On a second release I added a Scenic driver and the result is nice for graphics, but the text doesn’t looks well because of the antialiasing…
So this week I released the first version of Chisel
, a library that can be used to write text on any device based on pixels (OLED, LCD, a LED Matrix).
Chisel is basically composed by two parts: a Font loader and a Renderer.
The only format supported for now is BDF which is a format for storing bitmap fonts (I want to add support for PCF in the future).
The use is pretty simple:
- Load the font…
{:ok, font} = Chisel.Font.load("you/font/file.bdf")
- … and write the text.
Chisel.Renderer.draw_text("Hello World!", x, y, font, put_pixel)
So… what is put_pixel?
Is just a function that is called with the coordinates of the pixel to paint.
put_pixel = fn x, y ->
device.draw_pixel(x, y)
end
Here there are some examples using OLED and some fonts from U8glib:

And that’s all! What do you think? Did you have this text rendering requirements ever?
I would love to hear some feedback!
Thanks @lawik for testing the first prototype with [Inky] (GitHub - pappersverk/inky: A library for managing Inky e-ink displays from Elixir. · GitHub)!
I hope you can found it useful and to see many people crafting things with tiny displays!
Thanks!
Trending in Announcing
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #ai
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 6- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
AstonJ
This is so cool! I love the display showing the emojis
Is this the module you are using?
https://www.amazon.co.uk/Hobby-Components-Ltd-SSD1306-Electronics/dp/B00KCM9JMG
LukeWood
Super awesome love it!
luisgabrielroldan
Yes! That one works with the OLED library.
lawik
I love that you made this thing. Absolutely wildly useful for small display projects. As you know there is plenty more I want us to try based off of this
jaimeiniesta
Hey @luisgabrielroldan that’s cool!
Do you think that would work with a Zio Qwiic OLED Display which is based on an SSD1327 chip?
I’m looking to attach an OLED to my Raspberry Pi Zero and it needs to be a Qwiic device because I’m using the Qwiic pHat connector already.
lawik
This here links to datasheets. That should help sus out if they are very different.
Chisel can make the pixels but the I assume the display driver is I2C and that will work/not work depending on what they did to it when they gave it a bigger number
Addresses might be different. There should be more stuff to write if the resolution is higher and so on.