Phi_big_font

Introduction:

The Phi_big_font library utilizes 3 X 5 dot matrix technique I developed to display characters 6 times the size of ordinary characters seen on HD44780-compatible character LCDs. You will need two rows and 4 columns to display one character (with one column blank to separate characters). A 16*2 display can display 4 such characters, making a perfect clock display like HH:MM, or month or day display in three characters. A 20*4 display can display 5 characters by two rows, totally 10. You can display the characters anywhere you want. Make an animation if you want. This library 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.

I initially made an attempt. Read this post with videos. I was successful but I didn’t make it into library neither did I make the display location more flexible or support 20 X 4 displays.

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

What it does:

  • Display big numbers 0 – 9
  • Display big characters A – Z and a – z
  • 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
  • Display one character, short strings, numbers (you can format numbers into strings if you prefer)
  • Display half (top or bottom) of a character if you want (for animations)

Updates:

06/17/2011: I have realized the array names that store the programmable characters for the LCD is the same in several libraries so I changed their names in this library to make sure there is no conflicts when multiple of my libraries are used in the same project. Updated the library to version 617.

Pictures and videos:

Here is some pictures of the font: The complete list can be found on this post.

Here is a video:

Functions:

void init_big_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_big_font(&lcd);
}

//Notice the & symbol

void invert_big_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_big_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

big_msg_lcd(“Haha”,0,0);

Eg.2

char msg=”LOL”;

big_msg_lcd(msg,0,0);

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

Display a number at location supplied.

Eg.1

render_big_number(4567,0,0);

Eg.2

int x=1234;

render_big_number(x*2,0,0);

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

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

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

This displays a character ch at the supplied location.

void render_big_char_bot(char ch);

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

void render_big_char_top(char ch);

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

void display_img(byte [] img);

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

Eg.1

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

display_img(img1);

Downloads:

The code and examples are hosted on Google code page:

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

Under the library folder you will find two showcase code sketches. The V4 is for both 20X4 and 16X2 displays and defaults to 16X2 display for more basic feature showing. You can make the change by changing #define lcd_16X2 into #define lcd_20X4.

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_big_font/ (Just example, your directory may be different). Make sure you don’t have c:/Arduino22/Sketchbooks/Libraries/phi_big_font/phi_big_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_big_font

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

OK you’re done!

Future directions:

Add symbols to the font

Store the font in PROGMEM

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

15 Responses to Phi_big_font

  1. Pingback: Phi big fonts available as a library « Liudr's Blog

  2. Juan Carlos says:

    Hi
    Thank you very much for your interest.
    With this library if that works for me perfectly and looks great.
    I have only one small problem, I want to leave the “character” in large (char 58) but can not. It is not important, but it would be nice to see big characters :, / etc
    sorry for my googlEnglish

  3. Pingback: Phi_super_font available « Liudr's Blog

  4. Pingback: Arduino Blog » Blog Archive » Big Fonts On LCD Library Turns To Second Version

  5. Pingback: Big Fonts On LCD Library Turns To Second Version | dev.SquareCows.com

  6. Greg says:

    Hi,
    How to make . or , ?
    sorry for my English
    Thanks.

    • liudr says:

      Greg,

      To save space I didn’t program in any symbols. So what other symbols do you need for your project besides ‘.’ and ‘,’? I can put them in once I have time towards the end of the this week.

  7. Tom says:

    Hi,
    When I try to upload the Phi 2 Alarm clock I get a compiling error.

    In file included from Phi_2_project_alarm_clock_v5.cpp:58:
    C:\Users\Tom\Desktop\arduino-1.0\libraries\phi_big_font/phi_big_font.h:18:22: error: WProgram.h: No such file or directory

    The big font files are there, so I don’t know what is wrong. Any help?

    • liudr says:

      Tom,

      Just upgraded the phi_big_font to be arduino 1.0 compatible. Please download it from the google code site:

      http://code.google.com/p/phi-big-font/downloads/detail?name=phi_big_font%2020120322.zip&can=2&q=#makechanges

      • Tom says:

        Hi,

        Thanks for fixing that, it now works great.

        I am having trouble getting the clock to work, I followed the steps but the clock time doesn’t change. Is the time I set the 15 in the example below?

        “RTC.set(DS1307_HR,15);”

        Thanks for the quick reply.

      • liudr says:

        Tom,

        There is a line on the code that is commented out it reads something like
        //#define set_RTC

        If you uncomment the line, a few lines in the setup() will run to start the clock. Once you upload this code, arduino starts the clock. But you need to comment this line again and upload so that the clock won’t start with the default time every time arduino starts. There’s some instructions with the alarm clock code.

      • Tom says:

        Hmm that is what I have been doing, not sure what is going wrong. When I try to change the time displayed nothing happens, regardless of if the line is commented or not. Sorry to keep bugging you with these questions, I’m not very good at this stuff.

        Thanks.

      • liudr says:

        Have you connected the I2C jumpers yet? They need to be connected. Please refer to the documentation.

  8. chris says:

    Please remember to change any refrence to wprogram.h to arduino.h in the library if you have a compile error on arduino 1.0.2. could not compile v6 alarm clock whent to debugging and found the error in the phi big font library.

    • liudr says:

      I remember I updated the library months ago to use arduino.h. Did you follow an old link to the pre-1.0 version? I’d like to know that link so I can remove it. Thanks.

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 48 other followers

%d bloggers like this: