exodia505
Joined: 07 Feb 2012 Posts: 34
|
GLCD Image |
Posted: Fri Mar 16, 2012 5:11 am |
|
|
Hello evrybody!!
i want to display a Bmp image using pic18f452 and GLCD(128x64) (ks0108 controller),i didn't find a software that convert Bmp to hex
So i tried a one that convert to decimal, i used a method already found it in this forum topics
But i got nothing just random display.
how to make this works
Code: |
const int 8 image [64][16]={
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,127,127,127, 63, 63, 63, 31, 31, 31,
15, 47, 47, 47, 39, 23,135,135,135,131, 3, 3, 3, 3, 3, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
0, 1, 1, 0, 0, 0, 1, 33, 33, 33, 33, 33, 97, 97, 97, 97,
97,195,195,195,131,131,131,135, 7, 7, 7, 7, 15, 15, 15, 15,
31, 31, 31, 63, 63, 63,127,127,127,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,127,127, 63, 31, 31, 15, 7,
7, 3, 3, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 6,
4, 4, 6, 14, 30,159,255,255,255,255,255,254,252,252,252,244,
164,180,148, 20, 24, 88, 80,242,242,242,240,240,240,248,240, 48,
24, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,192,144,128,
0, 0, 0, 0, 1, 3, 3, 3, 7, 6, 8, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 3, 3, 7,
7, 15, 31, 31, 63, 63,127,255,255,255,255,255,255,255,255,255,
255,255,127, 31, 15, 7, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0,128,134,255,255,254,252,254,255,255,255,255,255,
255,255,127,127,255,255,255,127,125,236,230,199,199,207,191,190,
252,252,124,124, 60, 24, 56, 56,120,120,224,224,192,192,255,255,
127,127,238,255,255,253, 61,153,200,206, 12, 4, 4, 0, 0, 8,
16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 7, 15, 31,127,255,255,
15, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 44,126,255,255,255,255,255,127,255,255,183,183,255,255,255,
255,255,255,255,255,255,255,255,255,252,251,255,255,255,255,255,
255,255,254,254,254,254,240,224,240,252,248,240,224,240,241,243,
249,249,249,159, 15, 23, 7, 7, 1, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 7,
224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 7, 3, 3, 3, 15, 31, 63, 63,127,255,255,
255,255,255,255,255,255,255,255,255,255,191, 63, 31, 31, 31, 31,
31, 31, 31, 31, 31, 31, 15, 15, 13, 15, 15, 15, 15, 15, 31, 55,
3, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,
255,255,252,248,224,192,128, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
1, 15, 15, 31, 31, 31, 31, 63, 63, 63, 57, 48, 32, 32, 0, 0,
0, 64, 64, 96,224,240,112,176,136,128,128,128,128,128, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,128,128,128,128,128,128, 0, 0, 0,128,
128,128, 0, 0, 0, 0, 0, 0, 0,128,192,224,240,252,255,255,
255,255,255,255,255,255,255,255,254,252,252,248,240,240,224,192,
192,128,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0,
0, 0, 0, 0,128,192,192,236,252,252,254,254,255,254,254,255,
255,255,255,255,255,255,255,255,255,255,127,127, 63,191,159,223,
205,236,246,242,249,253,252,254,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,254,254,254,252,252,248,248,248,240,240,240,
240,224,224,224,192,192,192,192,192,128,128,128,128,128,128,128,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0,128,128,131,131,135,135,199,199,199,199,199,239,239,239,247,
247,247,243,251,251,249,253,253,254,254,254,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
};
//display function is :
void glcd_image()
{
char i,j;
signed char k;
for( i = 0 ; i < 64 ; i ++ )
{
for( j = 0 ; j < 16 ; j ++)
{
for(k=7;k>-1;--k)
{
if( bit_test(image[i][j] ,7-k ))
glcd_pixel( j*8+k,i, ON );
}
}
}
}
void main()
{
................
.
.
glcd_image();
} |
is it obligatory to convert to hex ??? _________________ NOway!!
Last edited by exodia505 on Fri Mar 16, 2012 8:10 am; edited 3 times in total |
|