248
chr = (ch - 32);
if(x_pos > (x_max - 6))
{
x_pos = 0;
y_pos++;
}
OLED_gotoxy(x_pos, y_pos);
for(s = 0; s < 6; s++)
{
OLED_write(font_regular[chr][s], DAT);
}
}
void OLED_print_string(unsigned char x_pos, unsigned char y_pos, unsigned char
*ch)
{
unsigned char chr = 0;
unsigned char i = 0;
unsigned char j = 0;
while(ch[j] != '\0')
{
chr = (ch[j] - 32);
if(x_pos > (x_max - 0x06))
{
x_pos = 0x00;
y_pos++;
}
OLED_gotoxy(x_pos, y_pos);
for(i = 0; i < 6; i++)
{
OLED_write(font_regular[chr][i], DAT);
}
j++;
x_pos += 6;
}
}
void OLED_print_chr(unsigned char x_pos, unsigned char y_pos, signed int value)
{
unsigned char ch = 0;
if(value < 0)
{
OLED_print_char(x_pos, y_pos, '-');
value = -value;
}
else
{
OLED_print_char(x_pos, y_pos,' ');
}