#include <Arduino.h>
#include <avr/io.h>
#include <math.h>
void setup() {
DDRD |=(1<<0);
DDRD |=(1<<1);
DDRD |=(1<<2);
DDRD |=(1<<3);
DDRD |=(1<<4);
DDRD |=(1<<5);
DDRD |=(1<<6);
DDRD |=(1<<7);
DDRB &~(1<<0);
DDRB &~ (1<<1);
DDRB |= (1<<2);
DDRB |= (1<<3);
DDRB |= (1<<4);
DDRB |= (1<<5);
DDRB |= (1<<6);
DDRB |= (1<<7);
DDRB |= (1<<8);
//PINB |=(1<<0);
}
int ce; //Counter EinerZiffern
int cz; //Counter Zehnerziffern
int ch; //Counter HunderterZiffern
int ct; //Counter TausenderZiffern
int c; //Counter
int main() {
setup();
int i=0;
int p = 0;
_delay_ms(600);
double array[10]={0x5F,0x6,0x3B,0x2F,0x66,0x6D,0x7D,0x07,0x7F,0x6F};
while (1){
for(ct=0; ct<10; ct++){
for(ch=0; ch<10; ch++){
for(cz=0; cz<10; cz++){
for(ce=0; ce<10; ce++){
for(c=0;c<15; c++){
PORTD=array[ce];
PORTB&=~(1<<5);
_delay_ms(10);
PORTB|=(1<<5);
PORTD=array[cz];
PORTB&=~(1<<4);
_delay_ms(10);
PORTB|=(1<<4);
PORTD=array[ch];
PORTB&=~(1<<3);
_delay_ms(10);
PORTB|=(1<<3);
PORTD=array[ct];
PORTB&=~(1<<2);
_delay_ms(10);
PORTB|=(1<<2);
}}}}}}}