LCD "Bigfont" Numbers over 2 or 4 lines

got it :smiley:

2line:

and showing a value (boost):

and showing it with 4line´s:

the code, for the 2lines:

(GitHub - designer2k2/multidisplay: The MultiDisplay Project, An opensource datalogger, boost controller and display for cars)

//Bigfont Code
//
//BIG parts from http://opengauge.googlecode.com/svn/trunk/mpguino/mpguino.pde

void CGRAM_BigFont2()
{

//255 is the "Full Block" Code, and 254 is blank
int data1[] = {31,31,31,0,0,0,0,0}; //Small Block on top
int data2[] = {0,0,0,0,0,31,31,31}; //Small Block on bottom
int data3[] = {31,31,31,0,0,0,31,31}; //Small Block on top and bottom
int data4[] = {28,30,31,31,31,31,30,28}; //Full Block roundet right
int data5[] = {7,15,31,31,31,31,15,7}; //Full Block roundet left
int data6[] = {0,0,0,14,14,14,12,8}; //Dot, for Decimal.

LcdUploadUdef5x8(1,data1);
LcdUploadUdef5x8(2,data2);
LcdUploadUdef5x8(3,data3);
LcdUploadUdef5x8(4,data4);
LcdUploadUdef5x8(5,data5);
LcdUploadUdef5x8(6,data6);

}

// Array index into parts of big numbers. Numbers consist of 6 custom characters in 2 lines
// 0 1 2 3 4 5 6 7 8 9
char bn12[]={255,1,255,0, 1,255,254,0, 1,3,4,0, 1,3,4,0, 255,2,2,0, 255,3,1,0, 5,3,1,0, 1,1,4,0, 5,3,4,0, 5,3,4,0};
char bn22[]={255,2,255,0, 2,255,2,0, 5,2,2,0, 2,2,4,0, 254,255,254,0, 2,2,4,0, 5,2,4,0, 254,255,254,0, 5,2,4,0, 254,254,255,0};

void printOneNumber2(uint8_t digit, byte leftAdjust, int LineOffset)
{
// LineOffset = 0, means 1 Line, LineOffset = 20 means 2 Line.
// leftAdjust = 0, means 1 Pos, leftAdjust = 1 is second Pos.

// Line 1 of the one digit number
lcd.commandWrite(0x80+LineOffset+leftAdjust3+1leftAdjust); //Line1
lcd.print(bn12[digit3]);
lcd.print(bn12[digit
3+1]);
lcd.print(bn12[digit*3+2]);

// Line 2 of the one-digit number
lcd.commandWrite(0xC0+LineOffset+leftAdjust3+1leftAdjust); // Line 2
lcd.print(bn22[digit3]);
lcd.print(bn22[digit
3+1]);
lcd.print(bn22[digit*3+2]);

}

void bigNum (unsigned long t, int LineOffset, byte leftAdjust, int d){

// LineOffset = 0, means 1 Line, LineOffset = 20 means 2 Line.
// d = 0, means no dp!

// unsigned long t = 98550ul;//number in thousandths
// unsigned long t = 9855ul;//number in thousandths
char dp = 254;
char dp2 = 254;

char * r = "009.99"; //default to 999
if(t<=99500){
r=format(t/10); //0098.6
dp=6;
}else if(t<=999500){
r=format(t/100);
}
if(t<=9950)
{
dp = 254;
dp2 = 6;
r=format(t); //009.86
}

if(d==0)
{
dp = 254;
dp2 = 254;
}

lcd.commandWrite(0x80+LineOffset+leftAdjust);
lcd.printIn(bn12+(r[2]-'0')*4);
lcd.printIn(" ");
lcd.printIn(bn12+(r[4]-'0')*4);
lcd.printIn(" ");
lcd.printIn(bn12+(r[5]-'0')*4);

lcd.commandWrite(0xC0+LineOffset+leftAdjust);
lcd.printIn(bn22+(r[2]-'0')*4);
lcd.print(dp2);
lcd.printIn(bn22+(r[4]-'0')*4);
lcd.print(dp);
lcd.printIn(bn22+(r[5]-'0')*4);

}

char fBuff[7];//used by format

char* format(unsigned long num){
byte dp = 3;

while(num > 999999){
num /= 10;
dp++;
if( dp == 5 ) break; // We'll lose the top numbers like an odometer
}
if(dp == 5) dp = 99; // We don't need a decimal point here.

// Round off the non-printed value.
if((num % 10) > 4)
num += 10;
num /= 10;
byte x = 6;
while(x > 0){
x--;
if(x==dp){ //time to poke in the decimal point?{
fBuff[x]='.';
}else{
fBuff[x]= '0' + (num % 10);//poke the ascii character for the digit.
num /= 10;
}
}
fBuff[6] = 0;
return fBuff;
}