Page 2 of 2

Posted: Tue Jan 16, 2007 9:10 am
by alejandrocordova
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.

Posted: Wed Jan 17, 2007 5:58 pm
by Jon
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