hi,
Do you have any way to get these characters implemented on your boards?
or i have to build my own bitmaps and implement the functions (place medium char 2x2)?
looking forward to hearing from you as soon as possible
Alejandro Cordova
P.S. enclosed is a portion of the display manual where you show these type of chars.
Medium/large digits problem
-
- LCD?
- Posts: 3
- Joined: Sat Dec 30, 2006 12:57 pm
- Attachments
-
- lcd2041.zip
- jpeg image that shows the type of chars that i am looking for.
- (92.11 KiB) Downloaded 494 times
-
- Matrix Orbital
- Posts: 231
- Joined: Mon Oct 24, 2005 10:38 am
- Location: Calgary, AB, Canada
- Contact:
Hi alejandrocordova,
sorry for not getting back to you sooner, the 2x2 characters would have to be implemented as custom characters.
The problem is, you can only have 8 custom charactes, and when the manual was created, instead of actually writing the code that would show the various screens, they were created in photoshop, and the limitations of the displays were not fully displayed.
Now, creating characters that are 2x2 in size is possible, the limitation is that you would only be able to have 2 numbers on the screen at once (ie 8 cutom characters).
So what you would need to do is have a rather complex set of functions like so:
void print2x2Number(x,y,number)
{
byte string[2];
sprintf(string,"%i",number);
print2x2Character(string,x,y);
}
void print2x2Character(char chars[],x,y)
{
int digit;
for(int i=0;i<2;i++)
{
digit = chars;
digit = digit - 48;
CharacterDefenitions2x2(digit,i);
DisplayCharacter(i,x+i,y);
}
}
void DisplayCharacter(int index,int x, int y)
{
switch(index)
{
case 0:
GoTo(x,y);
USART_Transmit(0);
GoTo(x+1,y);
USART_Transmit(1);
GoTo(x,y+1);
USART_Transmit(2);
GoTo(x+1,y+1);
USART_Transmit(3);
case 1:
GoTo(x,y);
USART_Transmit(4);
GoTo(x+1,y);
USART_Transmit(5);
GoTo(x,y+1);
USART_Transmit(6);
GoTo(x+1,y+1);
USART_Transmit(7);
}
}
void CharacterDefenitions2x2(int value, int index)
{
switch(value)
{
case 1:
CustomChar(to be filled in);
case 2:
CustomChar(to be filled in);
...
}
}
void customChar(byte x, byte a,byte b,byte c,byte d,byte e,byte f,byte g,byte h)
{
USART_Transmit(254);
USART_Transmit(78);
USART_Transmit(x);
USART_Transmit(a);
USART_Transmit(b);
USART_Transmit(c);
USART_Transmit(d);
USART_Transmit(e);
USART_Transmit(f);
USART_Transmit(g);
USART_Transmit(h);
}
void GoTo(int x, int y)
{
USART_Transmit(254);
USART_Transmit(71);
USART_Transmit(x);
USART_Transmit(y);
}
-------
I haven't tested it but i've used some of the functions before, so as long as you put int the custom character data for how you want the digits to look, i think it should work.
--
Jon
sorry for not getting back to you sooner, the 2x2 characters would have to be implemented as custom characters.
The problem is, you can only have 8 custom charactes, and when the manual was created, instead of actually writing the code that would show the various screens, they were created in photoshop, and the limitations of the displays were not fully displayed.
Now, creating characters that are 2x2 in size is possible, the limitation is that you would only be able to have 2 numbers on the screen at once (ie 8 cutom characters).
So what you would need to do is have a rather complex set of functions like so:
void print2x2Number(x,y,number)
{
byte string[2];
sprintf(string,"%i",number);
print2x2Character(string,x,y);
}
void print2x2Character(char chars[],x,y)
{
int digit;
for(int i=0;i<2;i++)
{
digit = chars;
digit = digit - 48;
CharacterDefenitions2x2(digit,i);
DisplayCharacter(i,x+i,y);
}
}
void DisplayCharacter(int index,int x, int y)
{
switch(index)
{
case 0:
GoTo(x,y);
USART_Transmit(0);
GoTo(x+1,y);
USART_Transmit(1);
GoTo(x,y+1);
USART_Transmit(2);
GoTo(x+1,y+1);
USART_Transmit(3);
case 1:
GoTo(x,y);
USART_Transmit(4);
GoTo(x+1,y);
USART_Transmit(5);
GoTo(x,y+1);
USART_Transmit(6);
GoTo(x+1,y+1);
USART_Transmit(7);
}
}
void CharacterDefenitions2x2(int value, int index)
{
switch(value)
{
case 1:
CustomChar(to be filled in);
case 2:
CustomChar(to be filled in);
...
}
}
void customChar(byte x, byte a,byte b,byte c,byte d,byte e,byte f,byte g,byte h)
{
USART_Transmit(254);
USART_Transmit(78);
USART_Transmit(x);
USART_Transmit(a);
USART_Transmit(b);
USART_Transmit(c);
USART_Transmit(d);
USART_Transmit(e);
USART_Transmit(f);
USART_Transmit(g);
USART_Transmit(h);
}
void GoTo(int x, int y)
{
USART_Transmit(254);
USART_Transmit(71);
USART_Transmit(x);
USART_Transmit(y);
}
-------
I haven't tested it but i've used some of the functions before, so as long as you put int the custom character data for how you want the digits to look, i think it should work.
--
Jon
Last edited by Jon on Wed Jan 17, 2007 6:14 pm, edited 3 times in total.