void CGRAM_BigFont4()
{
//255 is the "Full Block" Code, and 254 is blank
int data1[] = {0,0,0,0,3,15,15,31}; //Small Block on bottom left
int data2[] = {0,0,0,0,31,31,31,31}; //Small Block on bottom right
int data3[] = {0,0,0,0,24,30,30,31}; //Small Block on bottom full
int data4[] = {31,15,15,3,0,0,0,0}; //Small Block on top left
int data5[] = {31,30,30,24,0,0,0,0}; //Small Block on top right
int data6[] = {31,31,31,31,0,0,0,0}; //Small Block on top full
int data7[] = {14,14,14,14,12,8,0,0}; //Dot, for Decimal.
LcdUploadUdef5x8(1,data1);
LcdUploadUdef5x8(2,data2);
LcdUploadUdef5x8(3,data3);
LcdUploadUdef5x8(4,data4);
LcdUploadUdef5x8(5,data5);
LcdUploadUdef5x8(6,data6);
LcdUploadUdef5x8(7,data7);
}
// Array index into parts of big numbers. Numbers consist of 12 custom characters in 4 lines
// 0 1 2 3 4 5 6 7 8 9
char bn14[]={1,2,3,0, 2,3,254,0, 1,2,3,0, 1,2,3,0, 2,254,254,0, 2,2,2,0, 1,2,3,0, 2,2,2,0, 1,2,3,0, 1,2,3,0};
char bn24[]={255,254,255,0, 254,255,254,0, 1,2,255,0, 254,2,255,0, 255,2,2,0, 255,2,2,0, 255,2,3,0, 254,2,255,0, 255,2,255,0, 255,254,255,0};
char bn34[]={255,254,255,0, 254,255,254,0, 255,254,254,0, 254,254,255,0, 254,255,254,0, 254,254,255,0, 255,254,255,0, 254,255,254,0, 255,254,255,0, 4,6,255,0};
char bn44[]={4,6,5,0, 6,6,6,0, 4,6,6,0, 4,6,5,0, 254,6,254,0, 6,6,5,0, 4,6,5,0, 254,6,254,0, 4,6,5,0, 254,254,6,0};
void printOneNumber4(uint8_t digit, byte leftAdjust)
{
// leftAdjust = 0, means 1 Pos, leftAdjust = 1 is second Pos.
// Line 1 of the one digit number
lcd.commandWrite(0x80+leftAdjust3+1leftAdjust); //Line 1
lcd.print(bn14[digit3]);
lcd.print(bn14[digit3+1]);
lcd.print(bn14[digit*3+2]);
// Line 2 of the one-digit number
lcd.commandWrite(0xC0+leftAdjust3+1leftAdjust); // Line 2
lcd.print(bn24[digit3]);
lcd.print(bn24[digit3+1]);
lcd.print(bn24[digit*3+2]);
// Line 3 of the one digit number
lcd.commandWrite(0x94+leftAdjust3+1leftAdjust); //Line 3
lcd.print(bn34[digit3]);
lcd.print(bn34[digit3+1]);
lcd.print(bn34[digit*3+2]);
// Line 4 of the one-digit number
lcd.commandWrite(0xD4+leftAdjust3+1leftAdjust); // Line 4
lcd.print(bn44[digit3]);
lcd.print(bn44[digit3+1]);
lcd.print(bn44[digit*3+2]);
}
void bigNum4 (unsigned long t, 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=7;
}else if(t<=999500){
r=format(t/100);
}
if(t<=9950)
{
dp = 254;
dp2 = 7;
r=format(t); //009.86
}
if(d==0)
{
dp = 254;
dp2 = 254;
}
lcd.commandWrite(0x80+leftAdjust);
lcd.printIn(bn14+(r[2]-'0')*4);
lcd.printIn(" ");
lcd.printIn(bn14+(r[4]-'0')*4);
lcd.printIn(" ");
lcd.printIn(bn14+(r[5]-'0')*4);
lcd.commandWrite(0xC0+leftAdjust);
lcd.printIn(bn24+(r[2]-'0')*4);
lcd.printIn(" ");
lcd.printIn(bn24+(r[4]-'0')*4);
lcd.printIn(" ");
lcd.printIn(bn24+(r[5]-'0')*4);
lcd.commandWrite(0x94+leftAdjust);
lcd.printIn(bn34+(r[2]-'0')*4);
lcd.printIn(" ");
lcd.printIn(bn34+(r[4]-'0')*4);
lcd.printIn(" ");
lcd.printIn(bn34+(r[5]-'0')*4);
lcd.commandWrite(0xD4+leftAdjust);
lcd.printIn(bn44+(r[2]-'0')*4);
lcd.print(dp2);
lcd.printIn(bn44+(r[4]-'0')*4);
lcd.print(dp);
lcd.printIn(bn44+(r[5]-'0')*4);
}