Writing on ports (Updated)

I need to write values on PORTD and is given below

unsigned char value = 0;

void setup(){
DDRD = 0xFF;
}

void loop(){
value = value + 1;
PORTD = value;
}

Output:
Displaying BCD value 1, 3, 7 … instead of 1,2,3,4…

That should only ever show a 1. value never changes.

Output:
Displaying BCD value 1, 3, 7 ... instead of 1,2,3,4...

If that is your real code, the output should be 1. The value in the poorly named variable never changes.

Sorry I have updated the code

What is connected to port D?

LEDs are connected

What happens if you put a delay() in the loop()?