byte DP = 2;
byte a = 4;
byte b = 3;
byte c = 5 ;
byte d = 6 ;
byte e = 7 ;
byte f = 8 ;
byte g = 9 ;
long nummer;
void setup() {
DDRB = B00000000;
PORTB = B00000100;
}
void loop() {
nummer = random(10);
if (nummer = 0){
pinMode(a, OUTPUT);
digitalWrite(a, HIGH);
digitalWrite(a, LOW);
pinMode(b, OUTPUT);
digitalWrite(b, HIGH);
digitalWrite(b, LOW);
pinMode(c, OUTPUT);
digitalWrite(c, HIGH);
digitalWrite(c, LOW);
pinMode(d, OUTPUT);
digitalWrite(d, HIGH);
digitalWrite(d, LOW);
pinMode(e, OUTPUT);
digitalWrite(e, HIGH);
digitalWrite(e, LOW);
pinMode(f, OUTPUT);
digitalWrite(f, HIGH);
digitalWrite(f, LOW);
}
if (nummer = 1){
pinMode(b, OUTPUT);
digitalWrite(b, HIGH);
digitalWrite(b, LOW);
pinMode(c, OUTPUT);
digitalWrite(c, HIGH);
digitalWrite(c, LOW);
}
if (nummer = 2){
pinMode(a, OUTPUT);
digitalWrite(a, HIGH);
digitalWrite(a, LOW);
pinMode(b, OUTPUT);
digitalWrite(b, HIGH);
digitalWrite(b, LOW);
pinMode(g, OUTPUT);
digitalWrite(g, HIGH);
digitalWrite(g, LOW);
pinMode(e, OUTPUT);
digitalWrite(e, HIGH);
digitalWrite(e, LOW);
pinMode(d, OUTPUT);
digitalWrite(d, HIGH);
digitalWrite(d, LOW);
}
if (nummer = 3){
pinMode(a, OUTPUT);
digitalWrite(a, HIGH);
digitalWrite(a, LOW);
pinMode(b, OUTPUT);
digitalWrite(b, HIGH);
digitalWrite(b, LOW);
pinMode(g, OUTPUT);
digitalWrite(g, HIGH);
digitalWrite(g, LOW);
pinMode(c, OUTPUT);
digitalWrite(c, HIGH);
digitalWrite(c, LOW);
pinMode(d, OUTPUT);
digitalWrite(d, HIGH);
digitalWrite(d, LOW);
}
if (nummer = 4){
pinMode(f, OUTPUT);
digitalWrite(f, HIGH);
digitalWrite(f, LOW);
pinMode(b, OUTPUT);
digitalWrite(b, HIGH);
digitalWrite(b, LOW);
pinMode(g, OUTPUT);
digitalWrite(g, HIGH);
digitalWrite(g, LOW);
pinMode(c, OUTPUT);
digitalWrite(c, HIGH);
digitalWrite(c, LOW);
}
if (nummer = 5){
pinMode(a, OUTPUT);
digitalWrite(a, HIGH);
digitalWrite(a, LOW);
pinMode(f, OUTPUT);
digitalWrite(f, HIGH);
digitalWrite(f, LOW);
pinMode(g, OUTPUT);
digitalWrite(g, HIGH);
digitalWrite(g, LOW);
pinMode(c, OUTPUT);
digitalWrite(c, HIGH);
digitalWrite(c, LOW);
pinMode(d, OUTPUT);
digitalWrite(d, HIGH);
digitalWrite(d, LOW);
}
if (nummer = 6){
pinMode(a, OUTPUT);
digitalWrite(a, HIGH);
digitalWrite(a, LOW);
pinMode(f, OUTPUT);
digitalWrite(f, HIGH);
digitalWrite(f, LOW);
pinMode(g, OUTPUT);
digitalWrite(g, HIGH);
digitalWrite(g, LOW);
pinMode(c, OUTPUT);
digitalWrite(c, HIGH);
digitalWrite(c, LOW);
pinMode(e, OUTPUT);
digitalWrite(e, HIGH);
digitalWrite(e, LOW);
pinMode(d, OUTPUT);
digitalWrite(d, HIGH);
digitalWrite(d, LOW);
}
if (nummer = 7){
pinMode(a, OUTPUT);
digitalWrite(a, HIGH);
digitalWrite(a, LOW);
pinMode(b, OUTPUT);
digitalWrite(b, HIGH);
digitalWrite(b, LOW);
pinMode(c, OUTPUT);
digitalWrite(c, HIGH);
digitalWrite(c, LOW);
}
if (nummer = 8){
pinMode(a, OUTPUT);
digitalWrite(a, HIGH);
digitalWrite(a, LOW);
pinMode(b, OUTPUT);
digitalWrite(b, HIGH);
digitalWrite(b, LOW);
pinMode(c, OUTPUT);
digitalWrite(c, HIGH);
digitalWrite(c, LOW);
pinMode(d, OUTPUT);
digitalWrite(d, HIGH);
digitalWrite(d, LOW);
pinMode(e, OUTPUT);
digitalWrite(e, HIGH);
digitalWrite(e, LOW);
pinMode(f, OUTPUT);
digitalWrite(f, HIGH);
digitalWrite(f, LOW);
pinMode(g, OUTPUT);
digitalWrite(g, HIGH);
digitalWrite(g, LOW);
}
if (nummer = 9){
pinMode(a, OUTPUT);
digitalWrite(a, HIGH);
digitalWrite(a, LOW);
pinMode(b, OUTPUT);
digitalWrite(b, HIGH);
digitalWrite(b, LOW);
pinMode(c, OUTPUT);
digitalWrite(c, HIGH);
digitalWrite(c, LOW);
pinMode(d, OUTPUT);
digitalWrite(d, HIGH);
digitalWrite(d, LOW);
pinMode(f, OUTPUT);
digitalWrite(f, HIGH);
digitalWrite(f, LOW);
pinMode(g, OUTPUT);
digitalWrite(g, HIGH);
digitalWrite(g, LOW);
}
}