Phi_super_font

Introduction:

The Phi_super_font library utilizes 5 X 7 dot matrix technique I developed to display characters 40 times the size of ordinary characters seen on HD44780-compatible character LCDs. You will need all four rows and 5 columns to display one character (with one column blank to separate characters). A 20*4 display can display 4 characters packed together. You can display the characters anywhere you want. Make an animation if you want. The most recent release is compatible with Arduino IDE 1.0

Background:

After some requests and inquiries on arduino forum, I decided to make big fonts for character LCDs, not just numbers, as seen in some examples, but numbers, and characters, so you can display a few large characters and see them from say 10 feet away. With the request from my blog reply, I pushed the envelop a bit more and developed super font to further increase the size of the characters to fully use 20X4 display areas.

I initially made phi_big_font. Read this page with videos. I was successful so I pushed for super font.

After some more work, now I present you phi_super_font library.

What it does:

  • Display super-sized characters including all A-Z, a-z, 0-9, and symbols
  • Display them anywhere within your display (no trimming at display edges)
  • Display regular or inverted fonts with inverted lcd_clear() to fill up the screen with black boxes (invert is hard to read)
  • Display one character, short strings, numbers (you can format numbers into strings if you prefer)
  • Display one row of dots for each character if you want (for animations)

Pictures and videos:

Here is some pictures of the font:

This slideshow requires JavaScript.

Here is a video:

Functions:

void init_super_font(LiquidCrystal *l);

This initializes the library. You MUST do this in your setup();
Eg.1
// in main program
LiquidCrystal lcd(7,8,9,10,11,12);

setup()
{
init_super_font(&lcd);
}

//Notice the & symbol

void invert_super_font(boolean inv);

If inv is true, all subsequent output is inverted with black background.

void lcd_clear();

Clears the LCD, except if it is inverted, fills it with black boxes.

void render_super_msg(char msg[], byte loc_x, byte loc_y);

Displays string message at screen location loc_x and loc_y (top left corner of the message). You need to supply the string AKA character array’s name to the function.

Eg.1

super_msg_lcd(“Haha”,0,0);

Eg.2

char msg=”LOL”;

super_msg_lcd(msg,0,0);

void render_super_number(int number, byte loc_x, byte loc_y);

Display a number at location supplied.

Eg.1

render_super_number(4567,0,0);

Eg.2

int x=1234;

render_super_number(x*2,0,0);

void super_msg_lcd(char* msg_line, byte loc_x, byte loc_y);

This is the same as the render_super_msg except you supply a string stored in PROGMEM.

void render_super_char(char ch, byte loc_x, byte loc_y);

This displays a character ch at the supplied location.

void render_super_char_0(char ch);

This displays the top row of a character ch at the current location.

void render_big_char_1(char ch);

This displays the second row of a character ch at the current location.

void render_super_char_2(char ch);

This displays the third row of a character ch at the current location.

void render_big_char_3(char ch);

This displays the bottom row of a character ch at the current location.

void display_img(byte [] img);

This displays a raw image of 20 wide by 8 tall on a 20 X 4 display. Each byte in the array represents a column of 2 pixels. The row order is 0, 2, 1, 3.

Eg.1

byte img1[]={
0,0,0,1,2,2,2,1,0,0,0,1,2,2,2,1,0,0,0,0,
0,0,2,1,0,2,0,1,2,0,2,1,0,0,0,1,2,0,0,0,
0,0,3,0,1,3,1,0,3,1,3,0,1,1,1,0,3,0,0,0,
0,0,0,0,2,2,2,0,0,0,0,0,2,2,2,0,0,0,0,0
};// line 0, 2, 1, 3 order.

display_img(img1); // This is the Arduino symbol, flipped left and right to avoid copyright stuff.

Downloads:

Please download the library on the Google code page:

http://code.google.com/p/phi-big-font/

Under the library folder you will find a showcase code sketch.

Installation:

First download the package, then extract the files under your Arduino Sketchbook/Libraries folder, so that the three files will be under c:/Arduino22/Sketchbooks/Libraries/phi_super_font/ (Just example, your directory may be different). Make sure you don’t have c:/Arduino22/Sketchbooks/Libraries/phi_super_font/phi_super_font/

Then close all Arduino IDE windows.

Reopen Arduino IDE, open a sketchbook you want to use the phi_buttons. Then choose under the Arduino IDE meny Sketch->Import library->phi_super_font

The Arduino IDE automatically creates a line in the beginning of your sketchbook: #include <phi_super_font.h>

OK you’re done!

Future directions:

Add symbols to the font to map HD44780 symbols such as left and right arrows, also add more symbols for physics use.

Store the font in PROGMEM

Add function to clip the display if you display outside of your screen

3 Responses to Phi_super_font

  1. Pingback: Phi_super_font available « Liudr's Blog

  2. Pedro Rodrigues says:

    Is possible do that in Raspberry PI with I2C ?

    • liudr says:

      Well,

      If you can write a program to receive command from Raspberry PI via IIC and then call the phi_super_font library, then it’s easy to do. I am not familiar with IIC program with RPI.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 51 other followers

%d bloggers like this: