# Problem writing to DLO3416 Display

Hello.

I'am using 10x DLO 3416 displays for a clock project. Most is working fine, except I'am using an LDR to set the brightness of the displays (working) and i want to write the analog value on the display (Non-working). A snippet of the code:

ldr_Value/4; // divide analog value down PORTA = ldr_Value/100+48;// digit 1 of analog value digit2(); display10(); PORTA = ldr_Value/10+48;// digit 2 of analog value digit3(); display10(); PORTA = ldr_Value%10+48; // digit 3 of analog value digit4(); display10();

Problem is, that digit 2 i not shown correctly on the display. It rolls over from 9 to non-numeric chars. Other two digits are shown correctly. How do I calculate digit 2 correctly ?

Best regards Christian

``````hundreds= ldr_value / 100;

PORTA = (ldr_Value - (hundreds * 100) )/10+48;// digit 2 of analog value
``````

Yours, TonyWilk

TonyWilk: ``` hundreds= ldr_value / 100;

PORTA = (ldr_Value - (hundreds * 100) )/10+48;// digit 2 of analog value

``````

Yours,
TonyWilk
``````

Fantastic, that is working great. Thank you very much, for a fast reply!!

Best regards Christian