#define segA PB0
#define segB PB1
#define segC PB2
#define segD PB3
#define segE PB4
#define segF PB5
#define segG PB6
#define segDP PB7
#define DIG1 PC13
#define DIG2 PC14
int i=0;
void setup() {
pinMode(segA, OUTPUT);
pinMode(segB, OUTPUT);
pinMode(segC, OUTPUT);
pinMode(segD, OUTPUT);
pinMode(segE, OUTPUT);
pinMode(segF, OUTPUT);
pinMode(segG, OUTPUT);
pinMode(segDP, OUTPUT);
pinMode(DIG1, OUTPUT);
pinMode(DIG2, OUTPUT);
}
void loop() {
switch(i){
case 0:
digitalWrite(DIG2, HIGH); //Ziffer 2 aus
digitalWrite(segA, LOW);
digitalWrite(segB, HIGH);
digitalWrite(segC, HIGH);
digitalWrite(segD, LOW);
digitalWrite(segE, LOW);
digitalWrite(segF, LOW);
digitalWrite(segG, LOW);
digitalWrite(segDP, LOW);
digitalWrite(DIG1, LOW); //Ziffer 1 an
i++;
delay(50);
break;
case 1:
digitalWrite(DIG1, HIGH); //Ziffer 1 aus
digitalWrite(segA, HIGH);
digitalWrite(segB, HIGH);
digitalWrite(segC, HIGH);
digitalWrite(segD, HIGH);
digitalWrite(segE, HIGH);
digitalWrite(segF, HIGH);
digitalWrite(segG, LOW);
digitalWrite(segDP, LOW);
digitalWrite(DIG2, LOW); //Ziffer 2 an
delay(50);
i=0;
break;
}
}