250
else if((value > 999) && (value <= 9999))
{
ch = ((value % 10000)/ 1000);
OLED_print_char((x_pos + 6), y_pos , (0x30 + ch));
ch = ((value % 1000) / 100);
OLED_print_char((x_pos + 12), y_pos , (0x30 + ch));
ch = ((value % 100) / 10);
OLED_print_char((x_pos + 18), y_pos , (0x30 + ch));
ch = (value % 10);
OLED_print_char((x_pos + 24), y_pos , (0x30 + ch));
OLED_print_char((x_pos + 30), y_pos , 0x20);
}
else if((value > 99) && (value <= 999))
{
ch = ((value % 1000) / 100);
OLED_print_char((x_pos + 6), y_pos , (0x30 + ch));
ch = ((value % 100) / 10);
OLED_print_char((x_pos + 12), y_pos , (0x30 + ch));
ch = (value % 10);
OLED_print_char((x_pos + 18), y_pos , (0x30 + ch));
OLED_print_char((x_pos + 24), y_pos , 0x20);
OLED_print_char((x_pos + 30), y_pos , 0x20);
}
else if((value > 9) && (value <= 99))
{
ch = ((value % 100) / 10);
OLED_print_char((x_pos + 6), y_pos , (0x30 + ch));
ch = (value % 10);
OLED_print_char((x_pos + 12), y_pos , (0x30 + ch));
OLED_print_char((x_pos + 18), y_pos , 0x20);
OLED_print_char((x_pos + 24), y_pos , 0x20);
OLED_print_char((x_pos + 30), y_pos , 0x20);
}
else
{
ch = (value % 10);
OLED_print_char((x_pos + 6), y_pos , (0x30 + ch));
OLED_print_char((x_pos + 12), y_pos , 0x20);
OLED_print_char((x_pos + 18), y_pos , 0x20);
OLED_print_char((x_pos + 24), y_pos , 0x20);
OLED_print_char((x_pos + 30), y_pos , 0x20);
}
}
void OLED_print_decimal(unsigned char x_pos, unsigned char y_pos, unsigned int
value, unsigned char points)
{
unsigned char ch = 0;
OLED_print_char(x_pos, y_pos, '.');