251
ch = (value / 1000);
OLED_print_char((x_pos + 6), y_pos , (0x30 + ch));
if(points > 1)
{
ch = ((value % 1000) / 100);
OLED_print_char((x_pos + 12), y_pos , (0x30 + ch));
if(points > 2)
{
ch = ((value % 100) / 10);
OLED_print_char((x_pos + 18), y_pos , (0x30 + ch));
if(points > 3)
{
ch = (value % 10);
OLED_print_char((x_pos + 24), y_pos , (0x30 + ch));
}
}
}
}
void OLED_print_float(unsigned char x_pos, unsigned char y_pos, float value,
unsigned char points)
{
signed long tmp = 0;
tmp = value;
OLED_print_int(x_pos, y_pos, tmp);
tmp = ((value - tmp) * 10000);
if(tmp < 0)
{
tmp = -tmp;
}
if((value >= 10000) && (value < 100000))
{
OLED_print_decimal((x_pos + 36), y_pos, tmp, points);
}
else if((value >= 1000) && (value < 10000))
{
OLED_print_decimal((x_pos + 30), y_pos, tmp, points);
}
else if((value >= 100) && (value < 1000))
{
OLED_print_decimal((x_pos + 24), y_pos, tmp, points);
}
else if((value >= 10) && (value < 100))
{
OLED_print_decimal((x_pos + 18), y_pos, tmp, points);
}
else if(value < 10)
{
OLED_print_decimal((x_pos + 12), y_pos, tmp, points);
if(value < 0)