Arduino Forum

Forum 2005-2010 (read only) => General => Exhibition => Topic started by: digimike on Feb 09, 2010, 07:19 am

Title: Large Alphanumeric on LCD
Post by: digimike on Feb 09, 2010, 07:19 am
This isn't the first time this has been done. I'm sure the code has allot to be desired but it works. I found this link for a similar project.
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1245352653

For one thing i didn't like the style of his numbers. Sure i could change the code used theer but i didn't understand how it all worked. My coding experience is quite limited at this point. So i decided to do my own more simplistic version.

I used the LiquidCrystal library's ability to create a custom character. Its limited to 8 5x8 characters. So i create 8 segments that are used to build large numbers using 2 lines on a 16x2 LCD.

Here is what they look like when put together.
(http://lh5.ggpht.com/_PwqQjVZfo_A/S3D9EX3TYCI/AAAAAAAAAKs/v4Wm5vEckFw/s720/IMG_0886.JPG)
(http://lh3.ggpht.com/_PwqQjVZfo_A/S3D9hjAcMGI/AAAAAAAAAKw/0MtZZF-GqZg/s720/IMG_0887.JPG)
(http://lh3.ggpht.com/_PwqQjVZfo_A/S3D97pVw4ZI/AAAAAAAAAK0/ig4k6VStibo/s720/IMG_0888.JPG)

The sketch i built has the numbers counting from 0 to 9 and then it keeps track of the number of program loops on the left in regular text/numbers. Then a reconfigured that sketch so it would display the numbers as seen in the pictures. But i'll post the code to the first one.

Code: [Select]
/*
A set of custom made large numbers for a 16x2 LCD using the
LiquidCrystal librabry. Works with displays compatible with the
Hitachi HD44780 driver.

The Cuicuit:
 LCD RS pin to D12
 LCD Enable pin to D11
 LCD D4 pin to D5
 LCD D5 pin to D4
 LCD D6 pin to D3
 LCD D7 pin to D2
 LCD Vee tied to a pot to control brightness
 LCD Vss and R/W tied to ground
 LCD Vcc to +5V
 LCD pin 15 tied to pushbutton for control of backlight
 
This code has the custum numbers counting from 0 to 9 on
the left hand side of the LCD with a 1 sec delay between
numbers. On the right is a counter tracking the number of
times the program has looped.
 
Made by Michael Pilcher
2/9/2010
*/

// include the library
#include <LiquidCrystal.h>

// initialize the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

// the 8 arrays that form each segment of the custom numbers
byte LT[8] =
{
 B00111,
 B01111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111
};
byte UB[8] =
{
 B11111,
 B11111,
 B11111,
 B00000,
 B00000,
 B00000,
 B00000,
 B00000
};
byte RT[8] =
{
 B11100,
 B11110,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111
};
byte LL[8] =
{
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B01111,
 B00111
};
byte LB[8] =
{
 B00000,
 B00000,
 B00000,
 B00000,
 B00000,
 B11111,
 B11111,
 B11111
};
byte LR[8] =
{
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11110,
 B11100
};
byte MB[8] =
{
 B11111,
 B11111,
 B11111,
 B00000,
 B00000,
 B00000,
 B11111,
 B11111
};
byte block[8] =
{
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111
};

// loop counter
int count = 0;
 
void setup()
{
 // assignes each segment a write number
 lcd.createChar(0,LT);
 lcd.createChar(1,UB);
 lcd.createChar(2,RT);
 lcd.createChar(3,LL);
 lcd.createChar(4,LB);
 lcd.createChar(5,LR);
 lcd.createChar(6,MB);
 lcd.createChar(7,block);
 
 // sets the LCD's rows and colums:
 lcd.begin(16, 2);
       
}

void custom0()
{ // uses segments to build the number 0
 lcd.setCursor(0,0); // set cursor to column 0, line 0 (first row)
 lcd.write(0);  // call each segment to create
 lcd.write(1);  // top half of the number
 lcd.write(2);
 lcd.setCursor(0, 1); // set cursor to colum 0, line 1 (second row)
 lcd.write(3);  // call each segment to create
 lcd.write(4);  // bottom half of the number
 lcd.write(5);
}

void custom1()
{
 lcd.setCursor(0,0);
 lcd.write(1);
 lcd.write(2);
 lcd.setCursor(0,1);
 lcd.write(4);
 lcd.write(7);
 lcd.write(4);
}

void custom2()
{
 lcd.setCursor(0,0);
 lcd.write(6);
 lcd.write(6);
 lcd.write(2);
 lcd.setCursor(0, 1);
 lcd.write(3);
 lcd.write(4);
 lcd.write(4);
}

void custom3()
{
 lcd.setCursor(0,0);
 lcd.write(6);
 lcd.write(6);
 lcd.write(2);
 lcd.setCursor(0, 1);
 lcd.write(4);
 lcd.write(4);
 lcd.write(5);
}

void custom4()
{
 lcd.setCursor(0,0);
 lcd.write(3);
 lcd.write(4);
 lcd.write(7);
 lcd.setCursor(2, 1);
 lcd.write(7);
}

void custom5()
{
 lcd.setCursor(0,0);
 lcd.write(3);
 lcd.write(6);
 lcd.write(6);
 lcd.setCursor(0, 1);
 lcd.write(4);
 lcd.write(4);
 lcd.write(5);
}

void custom6()
{
 lcd.setCursor(0,0);
 lcd.write(0);
 lcd.write(6);
 lcd.write(6);
 lcd.setCursor(0, 1);
 lcd.write(3);
 lcd.write(4);
 lcd.write(5);
}

void custom7()
{
 lcd.setCursor(0,0);
 lcd.write(1);
 lcd.write(1);
 lcd.write(2);
 lcd.setCursor(2, 1);
 lcd.write(7);
}

void custom8()
{
 lcd.setCursor(0,0);
 lcd.write(0);
 lcd.write(6);
 lcd.write(2);
 lcd.setCursor(0, 1);
 lcd.write(3);
 lcd.write(4);
 lcd.write(5);
}

void custom9()
{
 lcd.setCursor(0,0);
 lcd.write(0);
 lcd.write(6);
 lcd.write(2);
 lcd.setCursor(2, 1);
 lcd.write(7);
}

void clearnumber()
{ // clears the area the custom number is displayed in
lcd.setCursor(0,0);
lcd.print("   ");
lcd.setCursor(0,1);
lcd.print("   ");
}

void loop()
{
 lcd.setCursor(5,0);  // puts cursor at columb 5, line 0
 lcd.print("Loop Count:");  // displays the words on LCD
 lcd.setCursor(9,1);  // sets cursor to column 9, line 1
 lcd.print(count);  // displays loop count on LCD
 clearnumber();  // clears the custom number
 custom0();    // displays custom 0 on the LCD
 delay(1000);  // delay 1 second
 clearnumber();
 custom1();
 delay(1000);
 clearnumber();
 custom2();
 delay(1000);
 clearnumber();
 custom3();
 delay(1000);
 clearnumber();
 custom4();
 delay(1000);
 clearnumber();
 custom5();
 delay(1000);
 clearnumber();
 custom6();
 delay(1000);
 clearnumber();
 custom7();
 delay(1000);
 clearnumber();
 custom8();
 delay(1000);
 clearnumber();
 custom9();
 delay(1000);
 count++;  // adds 1 to the loop count
}
Title: Re: Large numbers on LCD
Post by: The_Bongmaster on Feb 09, 2010, 07:24 am
looks nice :)

i should give it a go.. would be nice to have this type of numbers on a display for things :3
Title: Re: Large numbers on LCD
Post by: digimike on Feb 09, 2010, 07:46 am
Thanks Bongmaster,

I always do this. I think i have something finalized and i go and make changes. I changed the 7 so that the bottom segment is in the middle. Changed the 5 so that the upper left segment has the curve on the upper left corner. I took the to small bars on the 1 off. I also replaced all of the full bar segments with ones with the corners cut. Now there is a new segment to help the numbers look more balanced. 9 still looks a bit off but you can't win them all.

So i guess i'll use this opportunity to post the code i used for the pictures. Modified as stated above, of course.
Code: [Select]
/*
A set of custom made large numbers for a 16x2 LCD using the
LiquidCrystal librabry. Works with displays compatible with the
Hitachi HD44780 driver.

The Cuicuit:
 LCD RS pin to D12
 LCD Enable pin to D11
 LCD D4 pin to D5
 LCD D5 pin to D4
 LCD D6 pin to D3
 LCD D7 pin to D2
 LCD Vee tied to a pot to control brightness
 LCD Vss and R/W tied to ground
 LCD Vcc to +5V
 LCD pin 15 tied to pushbutton for control of backlight
 
Made by Michael Pilcher
2/9/2010
*/

// include the library
#include <LiquidCrystal.h>

// initialize the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

// the 8 arrays that form each segment of the custom numbers
byte LT[8] =
{
 B00111,
 B01111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111
};
byte UB[8] =
{
 B11111,
 B11111,
 B11111,
 B00000,
 B00000,
 B00000,
 B00000,
 B00000
};
byte RT[8] =
{
 B11100,
 B11110,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111
};
byte LL[8] =
{
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B01111,
 B00111
};
byte LB[8] =
{
 B00000,
 B00000,
 B00000,
 B00000,
 B00000,
 B11111,
 B11111,
 B11111
};
byte LR[8] =
{
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11110,
 B11100
};
byte UMB[8] =
{
 B11111,
 B11111,
 B11111,
 B00000,
 B00000,
 B00000,
 B11111,
 B11111
};
byte LMB[8] =
{
 B11111,
 B00000,
 B00000,
 B00000,
 B00000,
 B11111,
 B11111,
 B11111
};

// loop counter
int x = 0;

 
void setup()
{
 // assignes each segment a write number
 lcd.createChar(0,LT);
 lcd.createChar(1,UB);
 lcd.createChar(2,RT);
 lcd.createChar(3,LL);
 lcd.createChar(4,LB);
 lcd.createChar(5,LR);
 lcd.createChar(6,UMB);
 lcd.createChar(7,LMB);
 
 // sets the LCD's rows and colums:
 lcd.begin(16, 2);
       
}

void custom0()
{ // uses segments to build the number 0
 lcd.setCursor(x, 0); // set cursor to column 0, line 0 (first row)
 lcd.write(0);  // call each segment to create
 lcd.write(1);  // top half of the number
 lcd.write(2);
 lcd.setCursor(x, 1); // set cursor to colum 0, line 1 (second row)
 lcd.write(3);  // call each segment to create
 lcd.write(4);  // bottom half of the number
 lcd.write(5);
}

void custom1()
{
 lcd.setCursor(x,0);
 lcd.write(1);
 lcd.write(2);
 lcd.setCursor(x+1,1);
 lcd.write(5);
}

void custom2()
{
 lcd.setCursor(x,0);
 lcd.write(6);
 lcd.write(6);
 lcd.write(2);
 lcd.setCursor(x, 1);
 lcd.write(3);
 lcd.write(7);
 lcd.write(7);
}

void custom3()
{
 lcd.setCursor(x,0);
 lcd.write(6);
 lcd.write(6);
 lcd.write(2);
 lcd.setCursor(x, 1);
 lcd.write(7);
 lcd.write(7);
 lcd.write(5);
}

void custom4()
{
 lcd.setCursor(x,0);
 lcd.write(3);
 lcd.write(4);
 lcd.write(2);
 lcd.setCursor(x+2, 1);
 lcd.write(5);
}

void custom5()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(6);
 lcd.write(6);
 lcd.setCursor(x, 1);
 lcd.write(7);
 lcd.write(7);
 lcd.write(5);
}

void custom6()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(6);
 lcd.write(6);
 lcd.setCursor(x, 1);
 lcd.write(3);
 lcd.write(7);
 lcd.write(5);
}

void custom7()
{
 lcd.setCursor(x,0);
 lcd.write(1);
 lcd.write(1);
 lcd.write(2);
 lcd.setCursor(x+1, 1);
 lcd.write(0);
}

void custom8()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(6);
 lcd.write(2);
 lcd.setCursor(x, 1);
 lcd.write(3);
 lcd.write(7);
 lcd.write(5);
}

void custom9()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(6);
 lcd.write(2);
 lcd.setCursor(x+2, 1);
 lcd.write(5);
}

void loop()
{
 custom0();    // displays custom 0 on the LCD
 x = x + 4;    // sifts cursor over 4 columns
 custom1();
 x = x + 4;
 custom2();
 x = x + 4;
 custom3();
 delay(4000);  // delay 4 seconds
 lcd.clear();  // clears the display
 x = 0;  // resets x to 0
 custom4();
 x = x + 4;
 custom5();
 x = x + 4;
 custom6();
 x = x + 4;
 custom7();
 delay(4000);
 lcd.clear();
 x = 0;
 custom8();
 x = x + 4;
 custom9();
 delay(4000);
 lcd.clear();
 x = 0;
 
}
Title: Re: Large numbers on LCD
Post by: designer2k2 on Feb 09, 2010, 09:29 am
Hello,

im always looking for new "fonts" and this ones are realy nice!  :)
Title: Re: Large numbers on LCD
Post by: mowcius on Feb 09, 2010, 09:39 am
Unfortunately I do not have a 16x2 LCD but I will the font on my 40x4 when I get home tonight. I need to get round to making myself a w line font soon.

Are you going to do alphanumeric characters? I might have a go if I have the time. I suppose on a 16x2 you don't have enough custom characters to be able to do things like R and Q though...

Mowcius
Title: Re: Large numbers on LCD
Post by: digimike on Feb 09, 2010, 03:18 pm
I've been thinking about that but only having 8 custom characters to work with keeps things limited. If there was a way to flip the character horizontally and vertically then it could be possible.  Then then i would only need 3 custom segments to handle the numbers.

Maybe i need to come up with a way i could redefine the characters on the fly. Like having multiple versions of the setup that can be called too to redefine the available segments.
Title: Re: Large numbers on LCD
Post by: KenH on Feb 09, 2010, 03:47 pm
That is slick Mike - and can see a couple of places I'd like to use that... but would like the letter "F" displayed also in thermometer type displays....  GREAT WORK!

Thanks for posting the info.

Ken H>
Title: Re: Large numbers on LCD
Post by: digimike on Feb 09, 2010, 04:00 pm
F and C are easy enough.

Code: [Select]
void customF()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(6);
 lcd.write(6);
 lcd.setCursor(x, 1);
 lcd.write(3);
}

void customC()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(1);
 lcd.write(1);
 lcd.setCursor(x,1);
 lcd.write(3);
 lcd.write(4);
 lcd.write(4);
}
Title: Re: Large numbers on LCD
Post by: GrooveFlotilla on Feb 09, 2010, 04:09 pm
For themometers, can you do a 'K'?
Title: Re: Large numbers on LCD
Post by: digimike on Feb 09, 2010, 04:15 pm
Here is a K.

Code: [Select]
void customK()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(4);
 lcd.write(5);
 lcd.setCursor(x,1);
 lcd.write(3);
 lcd.write(1);
 lcd.write(2);
}


Or you can do it like this so it doesn't look so bulky.

Code: [Select]
void customK()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(4);
 lcd.write(5);
 lcd.setCursor(x,1);
 lcd.write(3);
 lcd.print(" ");
 lcd.write(2);
}


For the hell of it i'm sure you could come up with a 'U' on your own. lol

EDIT:
In case anyone wants it here is 'M' 'P' and 'H'. just keep in mind that the 'M' takes up 5 columns vs. the 3 that all the others take.

Code: [Select]
void customM()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(1);
 lcd.write(3);
 lcd.write(1);
 lcd.write(2);
 lcd.setCursor(x,1);
 lcd.write(3);
 lcd.print("   ");
 lcd.write(5);
}

void customP()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(6);
 lcd.write(2);
 lcd.setCursor(x, 1);
 lcd.write(3);
}

void customH()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(4);
 lcd.write(2);
 lcd.setCursor(x, 1);
 lcd.write(3);
 lcd.print(" ");
 lcd.write(5);
}


Title: Re: Large numbers on LCD
Post by: KenH on Feb 09, 2010, 07:06 pm
Shucks Mike - now you've done gone and done it! Made it so I will have to work on that to get a thermometer displaying these large fonts.  I won't have time just now, but will be saving this thread for study in a week or so.

Thanks for your work.

Ken H.
Title: Re: Large numbers on LCD
Post by: digimike on Feb 09, 2010, 07:22 pm
Quote
I suppose on a 16x2 you don't have enough custom characters to be able to do things like R and Q though...


Been thinking on this and i think i have 'R' and 'Q" figured out. The big problem i see is with 'N', 'M', and 'W" taking up so many columns. But the full alphabet is doable with these segments.

Code: [Select]
void customR()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(6);
 lcd.write(5);
 lcd.setCursor(x,1);
 lcd.write(3);
 lcd.print(" ");
 lcd.write(2);
}

void customQ()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(1);
 lcd.write(2);
 lcd.setCursor(x, 1);
 lcd.write(3);
 lcd.write(4);
 lcd.write(3);
 lcd.write(4);
}


Should have the full alphabet done by the end of the day. That is if i can remember to bring the code with me to work.
Title: Re: Large numbers on LCD
Post by: digimike on Feb 09, 2010, 08:09 pm
Here it is. Full code for a large custom alphanumeric display taking up 2 lines of a 16x2 or larger LCD display. The code displays all the letters and numbers.

Code: [Select]
/*
A set of custom made large numbers for a 16x2 LCD using the
LiquidCrystal librabry. Works with displays compatible with the
Hitachi HD44780 driver.

The Cuicuit:
LCD RS pin to D12
LCD Enable pin to D11
LCD D4 pin to D5
LCD D5 pin to D4
LCD D6 pin to D3
LCD D7 pin to D2
LCD Vee tied to a pot to control brightness
LCD Vss and R/W tied to ground
LCD Vcc to +5V
LCD pin 15 tied to pushbutton for control of backlight

Made by Michael Pilcher
2/9/2010
*/

// include the library
#include <LiquidCrystal.h>

// initialize the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int x = 0;
// the 8 arrays that form each segment of the custom numbers
byte LT[8] =
{
 B00111,
 B01111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111
};
byte UB[8] =
{
 B11111,
 B11111,
 B11111,
 B00000,
 B00000,
 B00000,
 B00000,
 B00000
};
byte RT[8] =
{
 B11100,
 B11110,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111
};
byte LL[8] =
{
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B01111,
 B00111
};
byte LB[8] =
{
 B00000,
 B00000,
 B00000,
 B00000,
 B00000,
 B11111,
 B11111,
 B11111
};
byte LR[8] =
{
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11110,
 B11100
};
byte UMB[8] =
{
 B11111,
 B11111,
 B11111,
 B00000,
 B00000,
 B00000,
 B11111,
 B11111
};
byte LMB[8] =
{
 B11111,
 B00000,
 B00000,
 B00000,
 B00000,
 B11111,
 B11111,
 B11111
};



void setup()
{
 // assignes each segment a write number
 lcd.createChar(0,LT);
 lcd.createChar(1,UB);
 lcd.createChar(2,RT);
 lcd.createChar(3,LL);
 lcd.createChar(4,LB);
 lcd.createChar(5,LR);
 lcd.createChar(6,UMB);
 lcd.createChar(7,LMB);

 // sets the LCD's rows and colums:
 lcd.begin(16, 2);

}

void custom0O()
{ // uses segments to build the number 0
 lcd.setCursor(x, 0);
 lcd.write(0);  
 lcd.write(1);
 lcd.write(2);
 lcd.setCursor(x, 1);
 lcd.write(3);  
 lcd.write(4);  
 lcd.write(5);
}

void custom1()
{
 lcd.setCursor(x,0);
 lcd.write(1);
 lcd.write(2);
 lcd.setCursor(x+1,1);
 lcd.write(5);
}

void custom2()
{
 lcd.setCursor(x,0);
 lcd.write(6);
 lcd.write(6);
 lcd.write(2);
 lcd.setCursor(x, 1);
 lcd.write(3);
 lcd.write(7);
 lcd.write(7);
}

void custom3()
{
 lcd.setCursor(x,0);
 lcd.write(6);
 lcd.write(6);
 lcd.write(2);
 lcd.setCursor(x, 1);
 lcd.write(7);
 lcd.write(7);
 lcd.write(5);
}

void custom4()
{
 lcd.setCursor(x,0);
 lcd.write(3);
 lcd.write(4);
 lcd.write(2);
 lcd.setCursor(x+2, 1);
 lcd.write(5);
}

void custom5S()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(6);
 lcd.write(6);
 lcd.setCursor(x, 1);
 lcd.write(7);
 lcd.write(7);
 lcd.write(5);
}

void custom6()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(6);
 lcd.write(6);
 lcd.setCursor(x, 1);
 lcd.write(3);
 lcd.write(7);
 lcd.write(5);
}

void custom7()
{
 lcd.setCursor(x,0);
 lcd.write(1);
 lcd.write(1);
 lcd.write(2);
 lcd.setCursor(x+1, 1);
 lcd.write(0);
}

void custom8()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(6);
 lcd.write(2);
 lcd.setCursor(x, 1);
 lcd.write(3);
 lcd.write(7);
 lcd.write(5);
}

void custom9()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(6);
 lcd.write(2);
 lcd.setCursor(x+2, 1);
 lcd.write(5);
}

void customA()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(6);
 lcd.write(2);
 lcd.setCursor(x, 1);
 lcd.write(3);
 lcd.print(" ");
 lcd.write(5);
}

void customB()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(6);
 lcd.write(5);
 lcd.setCursor(x, 1);
 lcd.write(3);
 lcd.write(7);
 lcd.write(2);
}

void customC()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(1);
 lcd.write(1);
 lcd.setCursor(x,1);
 lcd.write(3);
 lcd.write(4);
 lcd.write(4);
}

void customD()
{
 lcd.setCursor(x, 0);
 lcd.write(2);  
 lcd.write(1);
 lcd.write(2);
 lcd.setCursor(x, 1);
 lcd.write(5);  
 lcd.write(4);  
 lcd.write(5);
}

void customE()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(6);
 lcd.write(6);
 lcd.setCursor(x, 1);
 lcd.write(3);
 lcd.write(7);
 lcd.write(7);
}

void customF()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(6);
 lcd.write(6);
 lcd.setCursor(x, 1);
 lcd.write(3);
}

void customG()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(1);
 lcd.write(1);
 lcd.setCursor(x,1);
 lcd.write(3);
 lcd.write(4);
 lcd.write(2);
}

void customH()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(4);
 lcd.write(2);
 lcd.setCursor(x, 1);
 lcd.write(3);
 lcd.print(" ");
 lcd.write(5);
}

void customI()
{
 lcd.setCursor(x,0);
 lcd.write(1);
 lcd.write(2);
 lcd.write(1);
 lcd.setCursor(x,1);
 lcd.write(4);
 lcd.write(5);
 lcd.write(4);
}

void customJ()
{
 lcd.setCursor(x+2,0);
 lcd.write(2);
 lcd.setCursor(x,1);
 lcd.write(4);
 lcd.write(4);
 lcd.write(5);
}

void customK()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(4);
 lcd.write(5);
 lcd.setCursor(x,1);
 lcd.write(3);
 lcd.print(" ");
 lcd.write(2);
}

void customL()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.setCursor(x,1);
 lcd.write(3);
 lcd.write(4);
 lcd.write(4);
}

void customM()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(1);
 lcd.write(3);
 lcd.write(1);
 lcd.write(2);
 lcd.setCursor(x,1);
 lcd.write(3);
 lcd.print("   ");
 lcd.write(5);
}

void customN()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(3);
 lcd.print(" ");
 lcd.write(2);
 lcd.setCursor(x,1);
 lcd.write(3);
 lcd.print(" ");
 lcd.write(2);
 lcd.write(5);
}

void customP()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(6);
 lcd.write(2);
 lcd.setCursor(x, 1);
 lcd.write(3);
}

void customQ()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(1);
 lcd.write(2);
 lcd.setCursor(x, 1);
 lcd.write(3);
 lcd.write(4);
 lcd.write(3);
 lcd.write(4);
}

void customR()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(6);
 lcd.write(5);
 lcd.setCursor(x,1);
 lcd.write(3);
 lcd.print(" ");
 lcd.write(2);
}

void customT()
{
 lcd.setCursor(x,0);
 lcd.write(1);
 lcd.write(2);
 lcd.write(1);
 lcd.setCursor(x,1);
 lcd.print(" ");
 lcd.write(5);
}

void customU()
{
 lcd.setCursor(x, 0);
 lcd.write(0);  
 lcd.print(" ");
 lcd.write(2);
 lcd.setCursor(x, 1);
 lcd.write(3);  
 lcd.write(4);  
 lcd.write(5);
}

void customV()
{
 lcd.setCursor(x, 0);
 lcd.write(3);  
 lcd.print("  ");
 lcd.write(5);
 lcd.setCursor(x+1, 1);
 lcd.write(3);  
 lcd.write(5);
}

void customW()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.print("   ");
 lcd.write(2);
 lcd.setCursor(x,1);
 lcd.write(3);
 lcd.write(4);
 lcd.write(0);
 lcd.write(4);
 lcd.write(5);
}

void customX()
{
 lcd.setCursor(x,0);
 lcd.write(3);
 lcd.write(4);
 lcd.write(5);
 lcd.setCursor(x,1);
 lcd.write(0);
 lcd.print(" ");
 lcd.write(2);
}

void customY()
{
 lcd.setCursor(x,0);
 lcd.write(3);
 lcd.write(4);
 lcd.write(5);
 lcd.setCursor(x+1,1);
 lcd.write(5);
}

void customZ()
{
 lcd.setCursor(x,0);
 lcd.write(1);
 lcd.write(6);
 lcd.write(5);
 lcd.setCursor(x, 1);
 lcd.write(0);
 lcd.write(7);
 lcd.write(4);
}


void loop()
{
 customA();
 x = x + 4;
 customB();
 x = x + 4;
 customC();
 x = x + 4;
 customD();
 delay(4000);  // delay 4 seconds
 lcd.clear();  // clears the display
 x = 0;  // resets x to 0
 customE();
 x = x + 4;
 customF();
 x = x + 4;
 customG();
 x = x + 4;
 customH();
 delay(4000);  // delay 4 seconds
 lcd.clear();  // clears the display
 x = 0;  // resets x to 0
 customI();
 x = x + 4;
 customJ();
 x = x + 4;
 customK();
 x = x + 4;
 customL();
 delay(4000);  
 lcd.clear();  
 x = 0;
 customM();
 x = x + 6;
 customN();
 x = x + 5;
 custom0O();
 delay(4000);  
 lcd.clear();  
 x = 0;
 customP();
 x = x + 4;
 customQ();
 x = x + 5;
 customR();
 x = x + 4;
 custom5S();
 delay(4000);  
 lcd.clear();  
 x = 0;
 customT();
 x = x + 4;
 customU();
 x = x + 4;
 customV();
 delay(4000);  
 lcd.clear();  
 x = 0;
 customW();
 x = x + 6;
 customX();
 delay(4000);  
 lcd.clear();  
 x = 0;
 customY();
 x = x + 4;
 customZ();
 delay(4000);  
 lcd.clear();  
 x = 0;
 custom0O();    // displays custom 0 on the LCD
 x = x + 4;    // sifts cursor over 4 columns
 custom1();
 x = x + 4;
 custom2();
 x = x + 4;
 custom3();
 delay(4000);  
 lcd.clear();  
 x = 0;  
 custom4();
 x = x + 4;
 custom5S();
 x = x + 4;
 custom6();
 x = x + 4;
 custom7();
 delay(4000);
 lcd.clear();
 x = 0;
 custom8();
 x = x + 4;
 custom9();
 delay(4000);
 lcd.clear();
 x = 0;
}



Enjoy!


EDIT: update 'N' and 'V' to look better.
Title: Re: Large Alphanumeric on LCD
Post by: digimike on Feb 09, 2010, 09:01 pm
Took these kind of quick before heading to work but here is the letters for you.
(http://lh6.ggpht.com/_PwqQjVZfo_A/S3G9KQnDtWI/AAAAAAAAALY/mCamrtLYl9M/s720/IMG_0893.JPG)
(http://lh5.ggpht.com/_PwqQjVZfo_A/S3G9SFbPxfI/AAAAAAAAALc/LS2DfyfnhpA/s640/IMG_0894.JPG)
(http://lh5.ggpht.com/_PwqQjVZfo_A/S3G9YJor_DI/AAAAAAAAALg/Iz1VLxXGJrM/s720/IMG_0895.JPG)
(http://lh3.ggpht.com/_PwqQjVZfo_A/S3G9eHrxK4I/AAAAAAAAALk/OPuXKEGYZdM/s720/IMG_0896.JPG)
(http://lh4.ggpht.com/_PwqQjVZfo_A/S3G9l3nfMgI/AAAAAAAAALo/nSyGMD8vBok/s720/IMG_0891.JPG)
(http://lh5.ggpht.com/_PwqQjVZfo_A/S3G9ufqGByI/AAAAAAAAALs/cYCFwh5iZn8/s720/IMG_0897.JPG)
(http://lh3.ggpht.com/_PwqQjVZfo_A/S3G91bmoLTI/AAAAAAAAALw/8ld3N-M9Vxw/s720/IMG_0898.JPG)
(http://lh5.ggpht.com/_PwqQjVZfo_A/S3G97illZ9I/AAAAAAAAAL0/VBWFpzZdrYk/s720/IMG_0899.JPG)
Title: Re: Large Alphanumeric on LCD
Post by: mowcius on Feb 10, 2010, 09:46 am
They look nice.

Quote
I've been thinking about that but only having 8 custom characters to work with keeps things limited. If there was a way to flip the character horizontally and vertically then it could be possible.  Then then i would only need 3 custom segments to handle the numbers.

Maybe i need to come up with a way i could redefine the characters on the fly. Like having multiple versions of the setup that can be called too to redefine the available segments.

You can redefine on the fly can you not. Call a code section to redifine and it should be simple enough.

Mowcius
Title: Re: Large Alphanumeric on LCD
Post by: borref on Feb 10, 2010, 10:53 am
Quote
You can redefine on the fly can you not.

You can, but (there's always a "but" right?) then characters already displayed and using the previously defined pattern will change. In other words you can only have 8 different patterns visible at the same time. If you change one - all characters relying on this pattern will change too.

A solution to this would be a graphics display where every pixel is addressable. Unfortunately they cost a lot more.
Title: Re: Large Alphanumeric on LCD
Post by: digimike on Feb 10, 2010, 12:47 pm
I'd like to get a decent sized graphic display. Is there any one that you guys would recommend over another? Any particular controller chip i should be looking out for?

I will be redefining the 'M' and the 'W' so they are not as wide. They will be similar to the 'N'.
Title: Re: Large Alphanumeric on LCD
Post by: designer2k2 on Feb 10, 2010, 12:59 pm
you always have a full block at 254 or 255, the other is then the empty block.

so it would be possible to make the D and other letters a little smoother  :)
Title: Re: Large Alphanumeric on LCD
Post by: digimike on Feb 10, 2010, 03:28 pm
I figured there was i just didn't know how to call it up. When i eventually get home i'll work on that. I'll be stuck here till at least Thursday morning cause of snow.
Title: Re: Large Alphanumeric on LCD
Post by: mowcius on Feb 10, 2010, 08:17 pm
Quote

You can, but (there's always a "but" right?) then characters already displayed and using the previously defined pattern will change. In other words you can only have 8 different patterns visible at the same time. If you change one - all characters relying on this pattern will change too.


Yeah, hadn't thought of that.

http://www.asciitable.com/
Can you display all of those?

Then you would only need a few custom characters to have lots of smooth letters.

Quote
I'd like to get a decent sized graphic display.
Yeah me too.

Mowcius

Title: Re: Large Alphanumeric on LCD
Post by: digimike on Feb 11, 2010, 05:47 pm
I have updated the library of characters. The letters now look allot better. There is also a '?' and '!'. I've also revised the code to scroll the letters. Unfortunately i couldn't get it to scroll the entire lineup of characters all at once. The buffer for it isn't big enough. I had to break it down into 4 segments.

Video will be posted later. As will the code if anyone wants it.


Title: Re: Large Alphanumeric on LCD
Post by: borref on Feb 11, 2010, 07:43 pm
Quote
I'd like to get a decent sized graphic display ...


This is my favorite:
http://ledsee.com/index.php?page=shop.product_details&flypage=flypage.tpl&product_id=244&category_id=23&option=com_virtuemart&Itemid=27

This 128x64 LCD works with a single 5V supply and comes with a prefitted 4-wire touchscreen.  The combination of LCD/touchscreen is good for prototype/one-off designs (no keypad needed). You get 8 lines with 21 characters (5x7) or 6 lines of text plus 4 large (good-to-push) buttons.

Add a top plate of brushed aluminium with a cutout for the display area and the finished project looks excellent and works well.
Title: Re: Large Alphanumeric on LCD
Post by: mowcius on Feb 11, 2010, 09:02 pm
Quote
This is my favorite:
http://ledsee.com/index.php?page=shop.product_details&flypage=flypage.tpl&produc...

That is nice. I have been looking for a graphic LCD to fit under my DS touch screen for a while now but that one takes the biscuit being all in one and at a decent price!

Mowcius
Title: Re: Large Alphanumeric on LCD
Post by: digimike on Feb 12, 2010, 03:16 am
Here is my first ever video posted online. One small change was made just after taking the video and while waiting for the upload to complete. I redefined the '5' a bit to differentiate it from the 'S'. The top left segment of the '5' has been replaced by a solid block. BTW that is in fact an official Arduino i just keep my motor shield plugged in all the time.
[media]http://www.youtube.com/watch?v=JamLLtJmQ50[/media]
Title: Re: Large Alphanumeric on LCD
Post by: msproul on Feb 12, 2010, 04:49 am
Mike

What do the LL, LB, etc stand for?

And yes I would like the updated code.

Thanks

Mark
Title: Re: Large Alphanumeric on LCD
Post by: mowcius on Feb 12, 2010, 09:24 am
Yeah I'd be interested in the updates code again too.

I have not got around to fiddling with the library myself yet but that will come this next week.

Mowcius
Title: Re: Large Alphanumeric on LCD
Post by: digimike on Feb 12, 2010, 04:43 pm
The LL, LT, UB, ect... are just abbreviations to help me designate which segment was which when referencing the large '0'.

LT= left top
UB= upper bar
RT= right top
LL= lower left
LB= lower bar
LR= lower right
UMB= upper middle bars(upper middle section of the '8')
LMB= lower middle bars(lower middle section of the '8')

Any label can go there. Then with
Code: [Select]
lcd.createChar(0,LT);
It takes that array and stores it as one of the 8 available custom characters. Then you use the
Code: [Select]
lcd.write(0);
to display that custom character on the LCD.

Here is the updated scrolling characters code. It will span 2 posts.
Code: [Select]
/*
A set of custom made large numbers for a 16x2 LCD using the
LiquidCrystal librabry. Works with displays compatible with the
Hitachi HD44780 driver.

The Cuicuit:
LCD RS pin to D12
LCD Enable pin to D11
LCD D4 pin to D5
LCD D5 pin to D4
LCD D6 pin to D3
LCD D7 pin to D2
LCD Vee tied to a pot to control brightness
LCD Vss and R/W tied to ground
LCD Vcc to +5V
LCD pin 15 tied to pushbutton for control of backlight

Made by Michael Pilcher
2/9/2010
*/

// include the library
#include <LiquidCrystal.h>

// initialize the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int x = 0;
// the 8 arrays that form each segment of the custom numbers
byte LT[8] =
{
 B00111,
 B01111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111
};
byte UB[8] =
{
 B11111,
 B11111,
 B11111,
 B00000,
 B00000,
 B00000,
 B00000,
 B00000
};
byte RT[8] =
{
 B11100,
 B11110,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111
};
byte LL[8] =
{
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B01111,
 B00111
};
byte LB[8] =
{
 B00000,
 B00000,
 B00000,
 B00000,
 B00000,
 B11111,
 B11111,
 B11111
};
byte LR[8] =
{
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11110,
 B11100
};
byte UMB[8] =
{
 B11111,
 B11111,
 B11111,
 B00000,
 B00000,
 B00000,
 B11111,
 B11111
};
byte LMB[8] =
{
 B11111,
 B00000,
 B00000,
 B00000,
 B00000,
 B11111,
 B11111,
 B11111
};



void setup()
{
 // assignes each segment a write number
 lcd.createChar(0,LT);
 lcd.createChar(1,UB);
 lcd.createChar(2,RT);
 lcd.createChar(3,LL);
 lcd.createChar(4,LB);
 lcd.createChar(5,LR);
 lcd.createChar(6,UMB);
 lcd.createChar(7,LMB);

 // sets the LCD's rows and colums:
 lcd.begin(16, 2);

}

void custom0O()
{ // uses segments to build the number 0
 lcd.setCursor(x, 0);
 lcd.write(0);  
 lcd.write(1);
 lcd.write(2);
 lcd.setCursor(x, 1);
 lcd.write(3);  
 lcd.write(4);  
 lcd.write(5);
}

void custom1()
{
 lcd.setCursor(x,0);
 lcd.write(1);
 lcd.write(2);
 lcd.setCursor(x+1,1);
 lcd.write(5);
}

void custom2()
{
 lcd.setCursor(x,0);
 lcd.write(6);
 lcd.write(6);
 lcd.write(2);
 lcd.setCursor(x, 1);
 lcd.write(3);
 lcd.write(7);
 lcd.write(7);
}

void custom3()
{
 lcd.setCursor(x,0);
 lcd.write(6);
 lcd.write(6);
 lcd.write(2);
 lcd.setCursor(x, 1);
 lcd.write(7);
 lcd.write(7);
 lcd.write(5);
}

void custom4()
{
 lcd.setCursor(x,0);
 lcd.write(3);
 lcd.write(4);
 lcd.write(2);
 lcd.setCursor(x+2, 1);
 lcd.write(5);
}

void custom5()
{
 lcd.setCursor(x,0);
 lcd.write(255);
 lcd.write(6);
 lcd.write(6);
 lcd.setCursor(x, 1);
 lcd.write(7);
 lcd.write(7);
 lcd.write(5);
}

void custom6()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(6);
 lcd.write(6);
 lcd.setCursor(x, 1);
 lcd.write(3);
 lcd.write(7);
 lcd.write(5);
}

void custom7()
{
 lcd.setCursor(x,0);
 lcd.write(1);
 lcd.write(1);
 lcd.write(2);
 lcd.setCursor(x+1, 1);
 lcd.write(0);
}

void custom8()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(6);
 lcd.write(2);
 lcd.setCursor(x, 1);
 lcd.write(3);
 lcd.write(7);
 lcd.write(5);
}

void custom9()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(6);
 lcd.write(2);
 lcd.setCursor(x+2, 1);
 lcd.write(5);
}

void customA()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(6);
 lcd.write(2);
 lcd.setCursor(x, 1);
 lcd.write(255);
 lcd.write(254);
 lcd.write(255);
}

void customB()
{
 lcd.setCursor(x,0);
 lcd.write(255);
 lcd.write(6);
 lcd.write(5);
 lcd.setCursor(x, 1);
 lcd.write(255);
 lcd.write(7);
 lcd.write(2);
}

void customC()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(1);
 lcd.write(1);
 lcd.setCursor(x,1);
 lcd.write(3);
 lcd.write(4);
 lcd.write(4);
}

void customD()
{
 lcd.setCursor(x, 0);
 lcd.write(255);  
 lcd.write(1);
 lcd.write(2);
 lcd.setCursor(x, 1);
 lcd.write(255);  
 lcd.write(4);  
 lcd.write(5);
}

void customE()
{
 lcd.setCursor(x,0);
 lcd.write(255);
 lcd.write(6);
 lcd.write(6);
 lcd.setCursor(x, 1);
 lcd.write(255);
 lcd.write(7);
 lcd.write(7);
}

void customF()
{
 lcd.setCursor(x,0);
 lcd.write(255);
 lcd.write(6);
 lcd.write(6);
 lcd.setCursor(x, 1);
 lcd.write(255);
}

void customG()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(1);
 lcd.write(1);
 lcd.setCursor(x,1);
 lcd.write(3);
 lcd.write(4);
 lcd.write(2);
}

void customH()
{
 lcd.setCursor(x,0);
 lcd.write(255);
 lcd.write(4);
 lcd.write(255);
 lcd.setCursor(x, 1);
 lcd.write(255);
 lcd.write(254);
 lcd.write(255);
}

void customI()
{
 lcd.setCursor(x,0);
 lcd.write(1);
 lcd.write(255);
 lcd.write(1);
 lcd.setCursor(x,1);
 lcd.write(4);
 lcd.write(255);
 lcd.write(4);
}

void customJ()
{
 lcd.setCursor(x+2,0);
 lcd.write(255);
 lcd.setCursor(x,1);
 lcd.write(4);
 lcd.write(4);
 lcd.write(5);
}

void customK()
{
 lcd.setCursor(x,0);
 lcd.write(255);
 lcd.write(4);
 lcd.write(5);
 lcd.setCursor(x,1);
 lcd.write(255);
 lcd.write(254);
 lcd.write(2);
}

void customL()
{
 lcd.setCursor(x,0);
 lcd.write(255);
 lcd.setCursor(x,1);
 lcd.write(255);
 lcd.write(4);
 lcd.write(4);
}

void customM()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(3);
 lcd.write(5);
 lcd.write(2);
 lcd.setCursor(x,1);
 lcd.write(255);
 lcd.write(254);
 lcd.write(254);
 lcd.write(255);
}

void customN()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(2);
 lcd.write(254);
 lcd.write(255);
 lcd.setCursor(x,1);
 lcd.write(255);
 lcd.write(254);
 lcd.write(3);
 lcd.write(5);
}

void customP()
{
 lcd.setCursor(x,0);
 lcd.write(255);
 lcd.write(6);
 lcd.write(2);
 lcd.setCursor(x, 1);
 lcd.write(255);
}

void customQ()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(1);
 lcd.write(2);
 lcd.setCursor(x, 1);
 lcd.write(3);
 lcd.write(4);
 lcd.write(255);
 lcd.write(4);
}

void customR()
{
 lcd.setCursor(x,0);
 lcd.write(255);
 lcd.write(6);
 lcd.write(2);
 lcd.setCursor(x,1);
 lcd.write(255);
 lcd.write(254);
 lcd.write(2);
}

void customS()
{
 lcd.setCursor(x,0);
 lcd.write(0);
 lcd.write(6);
 lcd.write(6);
 lcd.setCursor(x, 1);
 lcd.write(7);
 lcd.write(7);
 lcd.write(5);
}

void customT()
{
 lcd.setCursor(x,0);
 lcd.write(1);
 lcd.write(255);
 lcd.write(1);
 lcd.setCursor(x,1);
 lcd.write(254);
 lcd.write(255);
}

void customU()
{
 lcd.setCursor(x, 0);
 lcd.write(255);  
 lcd.write(254);
 lcd.write(255);
 lcd.setCursor(x, 1);
 lcd.write(3);  
 lcd.write(4);  
 lcd.write(5);
}

void customV()
{
 lcd.setCursor(x, 0);
 lcd.write(3);  
 lcd.write(254);
 lcd.write(254);
 lcd.write(5);
 lcd.setCursor(x+1, 1);
 lcd.write(2);  
 lcd.write(0);
}

void customW()
{
 lcd.setCursor(x,0);
 lcd.write(255);
 lcd.write(254);
 lcd.write(254);
 lcd.write(255);
 lcd.setCursor(x,1);
 lcd.write(3);
 lcd.write(0);
 lcd.write(2);
 lcd.write(5);
}

void customX()
{
 lcd.setCursor(x,0);
 lcd.write(3);
 lcd.write(4);
 lcd.write(5);
 lcd.setCursor(x,1);
 lcd.write(0);
 lcd.write(254);
 lcd.write(2);
}

void customY()
{
 lcd.setCursor(x,0);
 lcd.write(3);
 lcd.write(4);
 lcd.write(5);
 lcd.setCursor(x+1,1);
 lcd.write(255);
}

void customZ()
{
 lcd.setCursor(x,0);
 lcd.write(1);
 lcd.write(6);
 lcd.write(5);
 lcd.setCursor(x, 1);
 lcd.write(0);
 lcd.write(7);
 lcd.write(4);
}

void customqm()
{
 lcd.setCursor(x,0);
 lcd.write(1);
 lcd.write(6);
 lcd.write(2);
 lcd.setCursor(x, 1);
 lcd.write(254);
 lcd.write(7);
}

void customsm()
{
 lcd.setCursor(x,0);
 lcd.write(255);
 lcd.setCursor(x, 1);
 lcd.write(7);
}

Title: Re: Large Alphanumeric on LCD
Post by: digimike on Feb 12, 2010, 04:44 pm
code continued
Code: [Select]
void letters1()
{
 customA();
 x = x + 4;
 customB();
 x = x + 4;
 customC();
 x = x + 4;
 customD();
 x = x + 4;
 customE();
 x = x + 4;
 customF();
 x = x + 4;
 customG();
 x = x + 4;
 customH();
 x = x + 4;
 customI();
 x = x + 4;
 customJ();
 delay(500);
}

void letters2()
{
 customK();
 x = x + 4;
 customL();
 x = x + 4;
 customM();
 x = x + 5;
 customN();
 x = x + 5;
 custom0O();
 x = x + 4;
 customP();
 x = x + 4;
 customQ();
 x = x + 5;
 customR();
 x = x + 4;
 customS();
 delay(500);
}

void letters3()
{
 customT();
 x = x + 4;
 customU();
 x = x + 4;
 customV();
 x = x + 5;
 customW();
 x = x + 5;
 customX();
 x = x + 4;
 customY();
 x = x + 4;
 customZ();
 x = x + 4;
 customqm();
 x = x + 4;
 customsm();
 delay(500);
}

void numbers()
{
 custom0O();    // displays custom 0 on the LCD
 x = x + 4;    // sifts cursor over 4 columns
 custom1();
 x = x + 4;
 custom2();
 x = x + 4;
 custom3();
 x = x + 4;
 custom4();
 x = x + 4;
 custom5();
 x = x + 4;
 custom6();
 x = x + 4;
 custom7();
 x = x + 4;
 custom8();
 x = x + 4;
 custom9();
 delay(500);
}



void loop()
{
 letters1();
 for (int positionCounter = 0; positionCounter < 24; positionCounter++) {
   lcd.scrollDisplayLeft();
   delay(500);
 }
 x = 0;
 lcd.clear();
 delay(500);
 letters2();
 for (int positionCounter = 0; positionCounter < 23; positionCounter++) {
   lcd.scrollDisplayLeft();
   delay(500);
 }
 x = 0;
 lcd.clear();
 delay(500);
 letters3();
 for (int positionCounter = 0; positionCounter < 23; positionCounter++) {
   lcd.scrollDisplayLeft();
   delay(500);
 }
 x = 0;
 lcd.clear();
 delay(500);
 numbers();
 for (int positionCounter = 0; positionCounter < 24; positionCounter++) {
   lcd.scrollDisplayLeft();
   delay(500);
 }
 x = 0;
 lcd.clear();
 delay(500);
}
Title: Re: Large Alphanumeric on LCD
Post by: TBAr on Feb 12, 2010, 05:53 pm
It's looking good, digimike!
Title: Re: Large Alphanumeric on LCD
Post by: digimike on Feb 12, 2010, 11:11 pm
I think the next display i get will be this one.

http://www.sparkfun.com/commerce/product_info.php?products_id=710

Then the real fun begins. I'll start porting some of the games i made on my old TI-85 graphing calculator. Shouldn't be to hard to go from TI-Basic to the Arduino's C.
Title: Re: Large Alphanumeric on LCD
Post by: mowcius on Feb 12, 2010, 11:17 pm
Quote
It's looking good, digimike!

Agreed.

I will take a more detailed look tomorrow :)

Mowcius
Title: Re: Large Alphanumeric on LCD
Post by: Photo-Worx on Feb 12, 2010, 11:26 pm
How easy would this be to use on a 4x20 LCD?
I don't have a 2x16...
What would need to be changed so you could print on 2 big lines(2 lines each)?

:-?
Title: Re: Large Alphanumeric on LCD
Post by: mowcius on Feb 12, 2010, 11:30 pm
You may want to look at:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1245352653

There are more. Just g**gle it :)

Mowcius
Title: Re: Large Alphanumeric on LCD
Post by: digimike on Feb 12, 2010, 11:58 pm
Your not limited to a 16x2 display. As it is the code will just use the top 2 lines of your display. On a 20x4 display you could have 2 lines of large characters. Your own personal code using the segments i have defined will have to designate when to set the cursor to line 3 for the next row.

In the sections that define the layout of each character you'll want to change it from this.
Code: [Select]
void custom2()
{
 lcd.setCursor(x,0);
 lcd.write(6);
 lcd.write(6);
 lcd.write(2);
 lcd.setCursor(x, 1);
 lcd.write(3);
 lcd.write(7);
 lcd.write(7);
}



To this:
Code: [Select]
void custom2()
{
 lcd.setCursor(x,y);
 lcd.write(6);
 lcd.write(6);
 lcd.write(2);
 lcd.setCursor(x, y+1);
 lcd.write(3);
 lcd.write(7);
 lcd.write(7);
}



The second setCursor() across all of them will have to be...
Code: [Select]
lcd.setCursor(x, y+2);
This way the bottom half of the letter will be in the right position.

If you wanted to have a character take up all 4 lines then you would need to redefine all the characters. Which wouldn't be all that hard to do. The custom segments all stay the same they just get laid out a bit differently. It would look funny but it can be done.
Title: Re: Large Alphanumeric on LCD
Post by: msproul on Feb 13, 2010, 01:52 am
Mike
I have taken your font and made it table driven. I am sure to some this might seem more complicated, but it is table driven, and uses no ram. The definitions are  in PROGMEM.

The function DrawBigChar takes x and y so it can work 4x20 screens
Now I have to incorporate it into my drivers.

Total code and tables take 640 bytes.

Thank you very much for sharing your large fonts.

Mark

Code: [Select]

//************************************************************************
//*      A set of custom made large numbers for a 16x2 LCD using the
//*      LiquidCrystal librabry. Works with displays compatible with the
//*      Hitachi HD44780 driver.
//*      
//*      orginal developed  by Michael Pilcher  2/9/2010
//*      there are 8 entries, 8 bytes per entry
//*      these are the building blocks to make the numbers


//*      The LL, LT, UB, ect... are rust abreviations to help me designate which segment was which when referencing the large '0'.
//*      LT= left top
//*      UB= upper bar
//*      RT= right top
//*      LL= lower left
//*      LB= lower bar
//*      LR= lower right
//*      UMB= upper middle bars(upper middle section of the '8')
//*      LMB= lower middle bars(lower middle section of the '8')

uint8_t      gBigFontShapeTable[] PROGMEM      =      {
//*      LT[8] =
 B00111,
 B01111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
//*      UB[8] =
 B11111,
 B11111,
 B11111,
 B00000,
 B00000,
 B00000,
 B00000,
 B00000,
//*      RT[8] =
 B11100,
 B11110,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
//*      LL[8] =
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B01111,
 B00111,
//*      LB[8] =
 B00000,
 B00000,
 B00000,
 B00000,
 B00000,
 B11111,
 B11111,
 B11111,
//*      LR[8] =
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11110,
 B11100,
//*      UMB[8] =
 B11111,
 B11111,
 B11111,
 B00000,
 B00000,
 B00000,
 B11111,
 B11111,
//*      LMB[8] =
 B11111,
 B00000,
 B00000,
 B00000,
 B00000,
 B11111,
 B11111,
 B11111


};


//************************************************************************
//*      6 numbers for each character
//*      9 means BLANK
uint8_t      gBigFontAsciiTable[] PROGMEM      =      {

     0,      1,      2,      3,      4,      5,            //      0x30      0
     1,      2,      32,      32,      5,      32,            //      0x31      1
     6,      6,      2,      3,      7,      7,            //      0x32      2
     6,      6,      2,      7,      7,      5,            //      0x33      3
     3,      4,      2,      32,      32,      5,            //      0x34      4
     0,      6,      6,      7,      7,      5,            //      0x35      5
     0,      6,      6,      3,      7,      5,            //      0x36      6
     1,      1,      2,      32,      0,      32,            //      0x37      7
     0,      6,      2,      3,      7,      5,            //      0x38      8
     0,      6,      2,      32,      32,      5,            //      0x39      9
     32,      32,      32,      32,      32,      32,            //      0x3A      
     32,      32,      32,      32,      32,      32,            //      0x3B
     32,      32,      32,      32,      32,      32,            //      0x3C
     32,      32,      32,      32,      32,      32,            //      0x3D
     32,      32,      32,      32,      32,      32,            //      0x3E
     1,      6,      2,      254,7,      32,            //      0x3F      ?

     32,      32,      32,      32,      32,      32,            //      0x40      @
     0,      6,      2,      255,254,255,      //      0x41      A
     255,6,      5,      255,7,      2,            //      0x42      B
     0,      1,      1,      3,      4,      4,            //      0x43      C
     255,1,      2,      255,4,      5,            //      0x44      D
     255,6,      6,      255,7,      7,            //      0x45      E
     255,6,      6,      255,32,      32,            //      0x46      F
     
     0,      1,      1,      3,      4,      2,            //      0x47      G
     255,4,      255,255,254,255,      //      0x48      H
     1,      255,1,      4,      255,4,            //      0x49      I
     32,      32,      255,4,      4,      5,            //      0x4A      J
     255,4,      5,      255,254,2,            //      0x4B      K
     255,32,      32,      255,4,      4,            //      0x4C      L
     32,      32,      32,      32,      32,      32,            //      0x4D      M      place holder
     32,      32,      32,      32,      32,      32,            //      0x4E      N      place holder
     0,      1,      2,      3,      4,      5,            //      0x4F      O      (same as zero)

     0,      6,      2,      3,      32,      32,            //      0x50      P
     32,      32,      32,      32,      32,      32,            //      0x51      Q
     0,      6,      5,      3,      32,      2,            //      0x52      R
     0,      6,      6,      7,      7,      5,            //      0x35      S      (same as 5)
     1,      2,      1,      32,      5,      32,            //      0x54      T
     2,      32,      2,      3,      4,      5,            //      0x55      U
     32,      32,      32,      32,      32,      32,            //      0x56      V      place holder
     32,      32,      32,      32,      32,      32,            //      0x57      W      place holder
     3,      4,      5,      0,      32,      2,            //      0x58      X
     3,      4,      5,      32,      5,      32,            //      0x59      Y
     1,      6,      5,      0,      7,      4,            //      0x5A      Z
     0

};

//*      we have a seperate table for the wide routines
uint8_t      gBigFontAsciiTableWide[] PROGMEM      =      {
//*      this table is 10 bytes, 2 rows of 5
//      ---top------------|
     0,      1,      3,      1,      2,      3,      32,      32,      32,      5,            //      0x4D      M            5-wide
     0,      3,      32,      2,      32,      3,      32,      2,      5,      32,            //      0x4E      N            4-wide
     0,      1,      2,      32,      32,      3,      4,      3,      4,      32,            //      0x51      Q            4-wide
     3,      32,      32,      5,      32,      32,      3,      5,      32,      32,            //      0x56      V            4-wide
     0,      32,      32,      32,      2,      3,      4,      0,      4,      5,            //      0x57      W            5-wide
     0
};


//************************************************************************
static void      BigNumber_SendCustomChars(void)
{
uint8_t      customCharDef[10];
uint8_t      ii;
int            jj;

     for (ii=0; ii<8; ii++)
     {
           for (jj=0; jj<8; jj++)
           {
                 customCharDef[jj]      =      pgm_read_byte_near(gBigFontShapeTable + (ii * 8) + jj);
           }
           gLCD.createChar(ii, customCharDef);
     }
}

//************************************************************************
//*      returns the width of the character
static int      DrawBigChar(int xLocation, int yLocation, char theChar)
{
int            offset;
int            ii;
char      theByte;
boolean      specialCase;
int            specialIndex;
int            charWidth;

     if (theChar >= 'A')
     {
           theChar      =      theChar & 0x5F;      //*      force to upper case
     }
     specialCase      =      true;
     switch (theChar)
     {
           case 'M':      charWidth      =      5;      specialIndex      =      0;      break;
           case 'N':      charWidth      =      4;      specialIndex      =      1;      break;
           case 'Q':      charWidth      =      4;      specialIndex      =      2;      break;
           case 'V':      charWidth      =      4;      specialIndex      =      3;      break;
           case 'W':      charWidth      =      5;      specialIndex      =      4;      break;
                 
           
           default:
                 charWidth      =      3;
                 specialCase      =      false;
                 offset            =      6 * (theChar - 0x30);
                 gLCD.setCursor(xLocation, yLocation);
                 for (ii=0; ii<3; ii++)
                 {
                       theByte      =      pgm_read_byte_near(gBigFontAsciiTable + offset + ii);
                       gLCD.write(theByte);
                 }

                 gLCD.setCursor(xLocation, yLocation + 1);
                 offset      +=      3;
                 for (ii=0; ii<3; ii++)
                 {
                       theByte      =      pgm_read_byte_near(gBigFontAsciiTable + offset + ii);
                       gLCD.write(theByte);
                 }
                 break;
     }
     if (specialCase)
     {
           //*
           offset            =      10 * specialIndex;
           gLCD.setCursor(xLocation, yLocation);
           for (ii=0; ii<charWidth; ii++)
           {
                 theByte      =      pgm_read_byte_near(gBigFontAsciiTableWide + offset + ii);
                 gLCD.write(theByte);
           }

           gLCD.setCursor(xLocation, yLocation + 1);
           offset      +=      5;
           for (ii=0; ii<charWidth; ii++)
           {
                 theByte      =      pgm_read_byte_near(gBigFontAsciiTableWide + offset + ii);
                 gLCD.write(theByte);
           }
     }
     return(charWidth);
}
Title: Re: Large Alphanumeric on LCD
Post by: digimike on Feb 13, 2010, 02:18 am
More complex to start with and understand but goes a long way into making it usable.

One thing to note. The '5' and 'S' are now different. The 'S' stays the same but one segment of the '5' has changed. So it should look like this.
Code: [Select]
 255,       6,      6,      7,      7,      5,            //      0x35      5

Title: Re: Large Alphanumeric on LCD
Post by: msproul on Feb 13, 2010, 03:29 am
Mike

Thanks, I made the change, I also added the punctuation chars, only exclamation and . (period) I wanted period because this will primarily be used for numeric display.
     32,      0,      32,      32,      4,      32,            //      0x21      !
     32,      32,      32,      32,      4,      32,            //      0x2E      . (period)

If you want to define more of the punctuation please do.

Mark
Title: Re: Large Alphanumeric on LCD
Post by: digimike on Feb 13, 2010, 04:07 am
OK. I had the '!' but used 7 for the bottom rather then 4.

Code: [Select]
void customsm()  // sm= !
{
 lcd.setCursor(x,0);
 lcd.write(255);
 lcd.setCursor(x, 1);
 lcd.write(7);
}


most other punctuation won't be possible with the custom segments as they are defined.
Title: Re: Large Alphanumeric on LCD
Post by: princedotty on Mar 11, 2010, 11:04 pm
hey guys, great thanks for this custom numbers development. I would like to make use of this special font for my digital clock display.any idea how to call this custom(); for example for seconds.

thanks :)

Title: Re: Large Alphanumeric on LCD
Post by: digimike on Mar 11, 2010, 11:30 pm
I'm sure trying to use these custom numbers will cause a clock to have some timing issues. You may not be able to get seconds to stay accurate. Personally i would use the large fonts to display the hours and minutes and leave the seconds on the normal fonts.
Title: Re: Large Alphanumeric on LCD
Post by: mowcius on Mar 12, 2010, 09:25 am
Quote
I'm sure trying to use these custom numbers will cause a clock to have some timing issues. You may not be able to get seconds to stay accurate. Personally i would use the large fonts to display the hours and minutes and leave the seconds on the normal fonts.

Hmm, maybe. I think that seconds would look good smaller too as it would then be easy to distinguish them from the rest.

Mowcius
Title: Re: Large Alphanumeric on LCD
Post by: duttydea on Jun 17, 2010, 10:34 pm
I am trying to output my DS1307 in large format!!

here is my basic code:
Code: [Select]
// include the library
#include <LiquidCrystal.h>
#include <Wire.h>
#include <RTClib.h>
// initialize the interface pins
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);


RTC_DS1307 RTC;



void setup()
{
Wire.begin();
   RTC.begin();

 // sets the LCD's rows and colums:
 lcd.begin(16, 2);

}

void loop(){
 DateTime now = RTC.now();
 lcd.setCursor(0, 0);
 lcd.print(now.day(), DEC);
   lcd.print('/');
   lcd.print(now.month(), DEC);
   lcd.print('/');
   lcd.print(now.year(), DEC);
   lcd.print(' ');
   
   lcd.setCursor(0, 1);
   lcd.print(now.hour(), DEC);
   lcd.print(':');
   lcd.print(now.minute(), DEC);
   lcd.print(':');
   lcd.print(now.second(), DEC);
   //lcd.println();
}


How can I use the output of the RTC  to the large font?

Thanks in advance!
Title: Re: Large Alphanumeric on LCD
Post by: msproul on Jun 18, 2010, 03:23 pm
DARRELL

The standard LCD library does not support the large fonts. These are an ad on done by digimike and I did some work on the code as well.

This extra code works by using the user defined character capabilities of the LCD display and then sending the right combination to create the character. The large character library takes care of this.

Go back through the post and you should be able to find the code. If not, I have a version of it that uses table driven lookup tables from program memory, much more efficent.

Mark
Title: Re: Large Alphanumeric on LCD
Post by: duttydea on Jun 18, 2010, 07:58 pm
Thanks for the Response.

I like the sound of the table version.

I have been trying to figure out how to display double numbers. I was thinking of using case statements but that is too long winded.

would it be possible to post your code?

Thanks Again.
Title: Re: Large Alphanumeric on LCD
Post by: msproul on Jun 19, 2010, 03:48 pm
Here is what I have. It uses program memory and a table for entry for each character

Code: [Select]


//************************************************************************
//*      A set of custom made large numbers for a 16x2 LCD using the
//*      LiquidCrystal librabry. Works with displays compatible with the
//*      Hitachi HD44780 driver.
//*      
//*      orginal developed  by Michael Pilcher  2/9/2010
//*      there are 8 entries, 8 bytes per entry
//*      these are the building blocks to make the numbers
//*      
//*      http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1265696343
//************************************************************************


//*      The LL, LT, UB, ect... are rust abreviations to help me designate which segment was which when referencing the large '0'.
//*      LT= left top
//*      UB= upper bar
//*      RT= right top
//*      LL= lower left
//*      LB= lower bar
//*      LR= lower right
//*      UMB= upper middle bars(upper middle section of the '8')
//*      LMB= lower middle bars(lower middle section of the '8')

uint8_t      gBigFontShapeTable[] PROGMEM      =      {
//*      LT[8] =
 B00111,
 B01111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
//*      UB[8] =
 B11111,
 B11111,
 B11111,
 B00000,
 B00000,
 B00000,
 B00000,
 B00000,
//*      RT[8] =
 B11100,
 B11110,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
//*      LL[8] =
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B01111,
 B00111,
//*      LB[8] =
 B00000,
 B00000,
 B00000,
 B00000,
 B00000,
 B11111,
 B11111,
 B11111,
//*      LR[8] =
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11111,
 B11110,
 B11100,
//*      UMB[8] =
 B11111,
 B11111,
 B11111,
 B00000,
 B00000,
 B00000,
 B11111,
 B11111,
//*      LMB[8] =
 B11111,
 B00000,
 B00000,
 B00000,
 B00000,
 B11111,
 B11111,
 B11111


};


//************************************************************************
//*      6 numbers for each character
//*      9 means BLANK
uint8_t      gBigFontAsciiTable[] PROGMEM      =      {

     32,      32,      32,      32,      32,      32,            //      0x20      space
     32,      0,      32,      32,      4,      32,            //      0x21      !
     32,      32,      32,      32,      32,      32,            //      0x22      
     32,      32,      32,      32,      32,      32,            //      0x23      
     32,      32,      32,      32,      32,      32,            //      0x24      
     32,      32,      32,      32,      32,      32,            //      0x25      
     32,      32,      32,      32,      32,      32,            //      0x26      
     32,      32,      32,      32,      32,      32,            //      0x27      
     32,      32,      32,      32,      32,      32,            //      0x28      
     32,      32,      32,      32,      32,      32,            //      0x29      
     32,      32,      32,      32,      32,      32,            //      0x2A      
     32,      32,      32,      32,      32,      32,            //      0x2B      
     32,      32,      32,      32,      32,      32,            //      0x2C      
     32,      32,      32,      32,      32,      32,            //      0x2D
     32,      32,      32,      32,      4,      32,            //      0x2E      . (period)
     32,      32,      32,      32,      32,      32,            //      0x2F      


     0,      1,      2,      3,      4,      5,            //      0x30      0
     1,      2,      32,      32,      5,      32,            //      0x31      1
     6,      6,      2,      3,      7,      7,            //      0x32      2
     6,      6,      2,      7,      7,      5,            //      0x33      3
     3,      4,      2,      32,      32,      5,            //      0x34      4
     255,6,      6,      7,      7,      5,            //      0x35      5
//      0,      6,      6,      7,      7,      5,            //      0x35      5
     0,      6,      6,      3,      7,      5,            //      0x36      6
     1,      1,      2,      32,      0,      32,            //      0x37      7
     0,      6,      2,      3,      7,      5,            //      0x38      8
     0,      6,      2,      32,      32,      5,            //      0x39      9
     32,      32,      32,      32,      32,      32,            //      0x3A      
     32,      32,      32,      32,      32,      32,            //      0x3B
     32,      32,      32,      32,      32,      32,            //      0x3C
     32,      32,      32,      32,      32,      32,            //      0x3D
     32,      32,      32,      32,      32,      32,            //      0x3E
     1,      6,      2,      254,7,      32,            //      0x3F      ?

     32,      32,      32,      32,      32,      32,            //      0x40      @
     0,      6,      2,      255,254,255,      //      0x41      A
     255,6,      5,      255,7,      2,            //      0x42      B
     0,      1,      1,      3,      4,      4,            //      0x43      C
     255,1,      2,      255,4,      5,            //      0x44      D
     255,6,      6,      255,7,      7,            //      0x45      E
     255,6,      6,      255,32,      32,            //      0x46      F
     
     0,      1,      1,      3,      4,      2,            //      0x47      G
     255,4,      255,255,254,255,      //      0x48      H
     1,      255,1,      4,      255,4,            //      0x49      I
     32,      32,      255,4,      4,      5,            //      0x4A      J
     255,4,      5,      255,254,2,            //      0x4B      K
     255,32,      32,      255,4,      4,            //      0x4C      L
     32,      32,      32,      32,      32,      32,            //      0x4D      M      place holder
     32,      32,      32,      32,      32,      32,            //      0x4E      N      place holder
     0,      1,      2,      3,      4,      5,            //      0x4F      O      (same as zero)

     0,      6,      2,      3,      32,      32,            //      0x50      P
     32,      32,      32,      32,      32,      32,            //      0x51      Q
     0,      6,      5,      3,      32,      2,            //      0x52      R
     0,      6,      6,      7,      7,      5,            //      0x35      S      (same as 5)
     1,      2,      1,      32,      5,      32,            //      0x54      T
     2,      32,      2,      3,      4,      5,            //      0x55      U
     32,      32,      32,      32,      32,      32,            //      0x56      V      place holder
     32,      32,      32,      32,      32,      32,            //      0x57      W      place holder
     3,      4,      5,      0,      32,      2,            //      0x58      X
     3,      4,      5,      32,      5,      32,            //      0x59      Y
     1,      6,      5,      0,      7,      4,            //      0x5A      Z
     0

};

//*      we have a seperate table for the wide routines
uint8_t      gBigFontAsciiTableWide[] PROGMEM      =      {
//*      this table is 10 bytes, 2 rows of 5
//      ---top------------|
     0,      1,      3,      1,      2,      3,      32,      32,      32,      5,            //      0x4D      M            5-wide
     0,      3,      32,      2,      32,      3,      32,      2,      5,      32,            //      0x4E      N            4-wide
     0,      1,      2,      32,      32,      3,      4,      3,      4,      32,            //      0x51      Q            4-wide
     3,      32,      32,      5,      32,      32,      3,      5,      32,      32,            //      0x56      V            4-wide
     0,      32,      32,      32,      2,      3,      4,      0,      4,      5,            //      0x57      W            5-wide
     0
};


//************************************************************************
static void      BigNumber_SendCustomChars(void)
{
uint8_t      customCharDef[10];
uint8_t      ii;
int            jj;

     for (ii=0; ii<8; ii++)
     {
           for (jj=0; jj<8; jj++)
           {
                 customCharDef[jj]      =      pgm_read_byte_near(gBigFontShapeTable + (ii * 8) + jj);
           }
           gLCD.createChar(ii, customCharDef);
     }
}

//************************************************************************
//*      returns the width of the character
static int      DrawBigChar(int xLocation, int yLocation, char theChar)
{
int            offset;
int            ii;
char      theByte;
boolean      specialCase;
int            specialIndex;
int            charWidth;

     if (theChar == 0x20)
     {
           return(2);
     }
     else if (theChar < 0x20)
     {
           return(0);
     }

     if (theChar >= 'A')
     {
           theChar      =      theChar & 0x5F;      //*      force to upper case
     }
     specialCase      =      true;
     switch (theChar)
     {
           case 'M':      charWidth      =      5;      specialIndex      =      0;      break;
           case 'N':      charWidth      =      4;      specialIndex      =      1;      break;
           case 'Q':      charWidth      =      4;      specialIndex      =      2;      break;
           case 'V':      charWidth      =      4;      specialIndex      =      3;      break;
           case 'W':      charWidth      =      5;      specialIndex      =      4;      break;
                 
           
           default:
                 charWidth      =      3;
                 specialCase      =      false;
                 offset            =      6 * (theChar - 0x20);
                 gLCD.setCursor(xLocation, yLocation);
                 for (ii=0; ii<3; ii++)
                 {
                       theByte      =      pgm_read_byte_near(gBigFontAsciiTable + offset + ii);
                       gLCD.write(theByte);
                 }

                 gLCD.setCursor(xLocation, yLocation + 1);
                 offset      +=      3;
                 for (ii=0; ii<3; ii++)
                 {
                       theByte      =      pgm_read_byte_near(gBigFontAsciiTable + offset + ii);
                       gLCD.write(theByte);
                 }
                 break;
     }
     if (specialCase)
     {
           //*
           offset            =      10 * specialIndex;
           gLCD.setCursor(xLocation, yLocation);
           for (ii=0; ii<charWidth; ii++)
           {
                 theByte      =      pgm_read_byte_near(gBigFontAsciiTableWide + offset + ii);
                 gLCD.write(theByte);
           }

           gLCD.setCursor(xLocation, yLocation + 1);
           offset      +=      5;
           for (ii=0; ii<charWidth; ii++)
           {
                 theByte      =      pgm_read_byte_near(gBigFontAsciiTableWide + offset + ii);
                 gLCD.write(theByte);
           }
     }
     return(charWidth + 1);
}



Title: Re: Large Alphanumeric on LCD
Post by: msproul on Jun 19, 2010, 03:50 pm
And this is the routine that calls the above routine

Code: [Select]

//************************************************************************
static boolean      LCD_ProcessChar(char theChar)
{
boolean      echoTheChar;

     //*      this is so all 4 lines get used, when a CR comes in, we will wait
     //*      until the next char to actually do the scrolling
     if (gNeedToScroll && (theChar != 0x0A))
     {
           LCD_BumpToNextLine(true);
           gNeedToScroll      =      false;
     }
     echoTheChar      =      false;
     switch(theChar)
     {
           case 0x07:                                    //*      Bell
                 TurnBellOn_Off(true);
                 break;
                 
           case 0x08:                                    //*      back space
                 gLCD_currentColumn--;
                 if (gLCD_currentColumn < 0)
                 {
                       gLCD_currentColumn      =      0;
                 }
                 gLCD.setCursor(gLCD_currentColumn, gLCD_currentRow);
                 echoTheChar      =      true;
                 break;

           case 0x09:                                    //*      tab
                 LCD_DisplayPrintableChar(0x20);
                 while (gLCD_currentColumn % 4)
                 {
                       LCD_DisplayPrintableChar(0x20);
                 }
                 break;

           case 0x0A:                                    //*      Line feed
                 echoTheChar      =      true;
                 break;

           case 0x0B:                                    //*      Vertical tab (the opposite of line feed)
                 gLCD_currentRow--;
                 if (gLCD_currentRow < 0)
                 {
                       gLCD_currentRow      =      0;
                 }
                 gLCD.setCursor(gLCD_currentColumn, gLCD_currentRow);
                 break;

           case 0x0C:                                    //*      form feed
                 LCD_ClearScreen();
                 echoTheChar      =      true;
                 break;
           
           case 0x0D:                                    //*      Carriage return
           #ifdef _ENABLE_BIG_FONTS_
                 if (gCurrentFont == kFont_Large)
                 {
                       gLCD_currentColumn      =      0;
                       gLCD_currentRow            +=      2;
                       if (gLCD_currentRow >= gLCD_MaxLines)
                       {
                             LCD_ClearScreen();
                       }
                       else
                       {
                             gLCD.clearLine(2);
                             gLCD.clearLine(3);
                       }
                 }
                 else
           #endif
                 {
                       if (gLCD_ScrollEnabled && (gLCD_currentRow == (gLCD_MaxLines - 1)))
                       {
                             //*      we dont want to do the CR if we just forced a bump because of line overflow
                             if (gWrapHasOccured == false)
                             {
                                   gNeedToScroll      =      true;
                             }
                       }
                       else
                       {
                             LCD_BumpToNextLine(true);
                       }
                 }
                 gWrapHasOccured      =      false;
                 echoTheChar            =      true;
                 break;
           
           case 0x0e:                                    //*      ^N SHIFT OUT - use alternate character set
                 SetFont(kFont_Alternate);
                 break;

           case 0x0f:                                    //*      ^O SHIFT IN, resume default character set
                 SetFont(kFont_Normal);
                 break;

           
           case 0x1B:                                    //*      ESCAPE
                 gEscapeSequenceActive      =      true;
                 break;
                 
           default:                              // display each character to the LCD
                 if (theChar >= 0x20)
                 {
                       echoTheChar      =      true;
                       switch(gCurrentFont)
                       {
                             case kFont_Alternate:
                                   LCD_DisplayPrintableChar(theChar + 0x80);
                                   break;
                             
                       #ifdef _ENABLE_BIG_FONTS_
                             case kFont_Large:
                                   if (gLCD_currentColumn >= (gLCD_MaxColumns - 2))
                                   {
                                         gLCD_currentColumn      =      0;
                                         gLCD_currentRow            +=      2;
                                         if (gLCD_currentRow >= gLCD_MaxLines)
                                         {
                                               gLCD_currentRow      =      0;
                                               gLCD.clearLine(0);
                                               gLCD.clearLine(1);
                                         }
                                         else
                                         {
                                               gLCD.clearLine(2);
                                               gLCD.clearLine(3);
                                         }
                                   }
                                   gLCD_currentColumn      +=      DrawBigChar(gLCD_currentColumn, gLCD_currentRow, theChar);
                                   break;
                       #endif

                             case kFont_Normal:
                             default:
                                   LCD_DisplayPrintableChar(theChar);
                                   break;
                       
                       }
                 }
                 break;
     }
#ifdef _ENABLE_MORSE_CODE_
     if (gEnableMorseCode)
     {
           SendMorseCode(theChar, gMorseCodeWPM);
     }
#endif
     return(echoTheChar);
}

Title: Re: Large Alphanumeric on LCD
Post by: nico765 on Aug 30, 2010, 10:09 pm
guys,

very cool work; could you give some clues on how to use it? would be nice to see a sample sketch.
I got lost once this 'table driven' code appeared.
I am trying to use it on a 4x20 display.

Regards,
Nico
Title: Re: Large Alphanumeric on LCD
Post by: royco on Sep 17, 2010, 08:58 am
Anybody has an example code using the lookup tables?
Title: Re: Large Alphanumeric on LCD
Post by: genedefect on Nov 20, 2010, 12:18 pm
What i have made with this characters.

its using 1/3 of the arduino memory,  ik can't easy translate the DEC output from te DS1307 to the new characters, i have made a whole list of possible time's to do this.

Youtube link can not be posten in first post
Title: Re: Large Alphanumeric on LCD
Post by: genedefect on Nov 20, 2010, 12:18 pm
http://www.youtube.com/watch?v=GEwKS_0ZxWg

so here it is :)
Title: Re: Large Alphanumeric on LCD
Post by: DE8MSH on Jan 24, 2011, 08:41 am
Hi,

this LCD font is awesome! I'l use it for a temperatur logging projekt. Until now it uses DS1307 for displaying time and date:

http://www.youtube.com/watch?v=qIBtUGEr5R8

Keep up the good work!