Demonstration project for Microchip AVR MCUs showing big, arbitrary fonts on an SSD1306 128 x 64 OLED display. Pictures of the fonts on the display can be found here: https://onmenwhostareongraphs.wordpress.com/2019/10/08/big-characters-for-monochrome-lcd-oled-displays/
The repository contains 3 projects:
- OLED_DISPLAY_4CHAR:Watch or counter with 4 digits representing seconds and minutes. The Display displays 4 digits plus a colon in Indie Flower Font, size 40 pixels. The counter starts immediately atfer boot and increases seconds.
- OLED_DISPLAY_6CHAR:Watch with 6 digits plus 2 colons, representing a watch with hours, minutes, seconds.
- OLED_DISPLAY_HELLO_WORLD_32: Hello World with different fonts, alternating "Hello" and "World" every 10 seconds.
The source code is a demonstration of displaying huge characters in any kind of Font. The fonts have been created with the python code in https://github.com/jdmorise/TTF2BMH. Arbitrary fonts can be downloaded from https://github.com/jdmorise/AVR_BMH-fonts.
Code OverviewThe code contains the following functions and libraries:main.c - main project, the timer, and the interrupt routinesi2c.c/i2c.h - I2C abstraction layer (using the hardware TWI block)lcd.c/lcd.h - definitions and functions to control the OLED displayfonts - folder containing all relevant fonts, including Indie Flower in different sizes and a generic 6x8 ascii font
The font can be changed by changing the #include statement in the lcd.c file and recompiling. If the size is changed, the respective character_height and character_width need to be set properly.
ContributorsThe LCD library has been developed by Michael Köhler, it was adapted and split into two parts to separate the LCD and I2C libraries. The basic description is found in a microcontroller.net forum: https://www.mikrocontroller.net/topic/415651
The zip file containing the library has been uploaded to this repo in the archive folder.
Comments
Please log in or sign up to comment.