const prog_uchar number[]=
{
; 源文件 / 文字 : 0123456789
; 宽×高(像素): 8×16
0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00,
0x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,
0x00,0x70,0x08,0x08,0x08,0x88,0x70,0x00,0x00,0x30,0x28,0x24,0x22,0x21,0x30,0x00,
0x00,0x30,0x08,0x88,0x88,0x48,0x30,0x00,0x00,0x18,0x20,0x20,0x20,0x11,0x0E,0x00,
0x00,0x00,0xC0,0x20,0x10,0xF8,0x00,0x00,0x00,0x07,0x04,0x24,0x24,0x3F,0x24,0x00,
0x00,0xF8,0x08,0x88,0x88,0x08,0x08,0x00,0x00,0x19,0x21,0x20,0x20,0x11,0x0E,0x00,
0x00,0xE0,0x10,0x88,0x88,0x18,0x00,0x00,0x00,0x0F,0x11,0x20,0x20,0x11,0x0E,0x00,
0x00,0x38,0x08,0x08,0xC8,0x38,0x08,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,
0x00,0x70,0x88,0x08,0x08,0x88,0x70,0x00,0x00,0x1C,0x22,0x21,0x21,0x22,0x1C,0x00,
0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x00,0x31,0x22,0x22,0x11,0x0F,0x00,
};
void show_num816(unsigned char x,unsigned char y, unsigned char *dp,unsigned char mode)
{
unsigned char i,n,m;
n=x;m=y;
for(i=0;i<8;i++)
{
Writecom1(0xb8+y);
Writecom1(0x40+x);
if(mode)
{Writedata1(pgm_read_byte(&dp));}
else
{Writedata1(~pgm_read_byte(&dp));}
}
x++;
}
x=n;y=m+1;
for(i=0;i<8;i++)
{
Writecom1(0xb8+y);
Writecom1(0x40+x);
if(mode)
{Writedata1(pgm_read_byte(&dp[i+8]));}
else
{Writedata1(~pgm_read_byte(&dp[i+8]));}
x++;
}
}
/************************************************************************/
int main (void)
{
cli(); //disable all interrupts
show_num816(0,0,&number,0);
}
/************************************************************************/
在调用show_num816(0,0,&number,0);时如何先增加指针的地址?试过用show_num816(0,0,&number+16,0);不行;
|