// 4 x 7 digit LED display control - no interrupt

const int8_t numbers [10] = {20, 215, 76, 69, 135, 37, 36, 87, 4, 5}; 

volatile uint8_t Digit_X00000, Digit_0X0000, Digit_00X000, Digit_000X00, Digit_0000X0, Digit_00000X; neu	                                                  // store single digits
volatile uint8_t active_digit = 0;									// active digit

void initialize_LED_display()
{	DDRD = 0b11111111;	
	DDRC = 0b00111111;  geändert
}

// Write number at indicated position to display
void digit (uint8_t value, uint8_t pin)
{	PORTD = numbers[value];			// number output
	PORTC &= ~(1 << pin);			// Low = current digit on
}

// distribute number to digits
void number_output (uint16_t number)
{
    Digit_X00000=number/100000;number %=100000; neu
    Digit_0X0000=number/10000;number %=10000;     neu
	Digit_00X000 = number/1000; number %= 1000;
	Digit_000X00 = number/100;  number %= 100;
	Digit_0000X0 = number/10;	  number %= 10;
	Digit_00000X = number;

}

void refresh() 
{	PORTC = 0b00111111; // Digits off geändert
	if(active_digit == 0) digit (Digit_X00000, PC0);
	if(active_digit == 1) digit (Digit_0X0000, PC1);
	if(active_digit == 2) digit (Digit_00X000, PC2);
	if(active_digit == 3) digit (Digit_000X00, PC3);
	if(active_digit == 4) digit (Digit_0000X0, PC4);geändert
	if(active_digit == 5) digit (Digit_00000X, PC5);geändert

	active_digit ++;				
	if (active_digit == 6 )active_digit = 0;	geändert 		
}