cocus/vc288-alt-fw

move value and comma

Opened this issue · 7 comments

how to move the sign and comma by 1 indicator to the right to get 04.1 volts

it makes no sense, display the second value after the decimal point

IMG_20210501_213509
ADC 8 bit

this value should be rounded and show not 4.07 but 04.1

Разобрался ! и настрои получилось так
Understood! and the mood turned out like this

/* 0.0 - 9.9 */
value = roundf(value * 10.0);
set_display_from_int(
(uint16_t)(value),
pos,
SEVEN_SEG_DP_MIDDLE,
SEVEN_SEG_DIGITS_ALL | SEVEN_SEG_DIGITS_LEFTMOST

enum display_set_align
{
DISPLAY_ALIGN_LEFT = 0,
DISPLAY_ALIGN_RIGHT = 1,
};
это работает если в обоих з вариантах 0 или в первом 0 во втором 1 или в обоих 1 или в первом 1 во втором 0 ну то есть все изменения ничего не меняют
it works if in both variants 0 or in the first 0 in the second 1 or in both 1 or in the first 1 in the second 0 well, that is, all changes do not change anything
this only works if
DISPLAY_ALIGN_LEFT = 0,
DISPLAY_ALIGN_RIGHT = 0,
или
or
DISPLAY_ALIGN_LEFT = 0,
DISPLAY_ALIGN_RIGHT = 1,
тоже самое ничего не меняется
the same nothing changes
DISPLAY_ALIGN_LEFT = 1,
DISPLAY_ALIGN_RIGHT = 0,
так же
same
DISPLAY_ALIGN_LEFT = 1,
DISPLAY_ALIGN_RIGHT = 1,

все хороши немного подправил код заработало приемлемо ! до изменения завышало показания
everything is all right, let's fix the code a little, everything worked! higher value before changing by 1-2 volts

image
image
image

    else if (value >= 10.0)
    {
        /* 10.0 - 99.9 */
        value = roundf(value * 9.56);
        set_display_from_int(
            (uint16_t)(value),
            pos,
            SEVEN_SEG_DP_MIDDLE,
            SEVEN_SEG_DIGITS_ALL
        );
    }
    else
    {
        /* 0.0 - 9.9 */
        value = roundf(value * 10.0);
        set_display_from_int(
            (uint16_t)(value),
            pos,
            SEVEN_SEG_DP_MIDDLE,
            SEVEN_SEG_DIGITS_ALL | SEVEN_SEG_DIGITS_LEFTMOST
        );
    }
}

}