int digit[] = {0x86, 0xDB, 0xCF, 0x66, 0xED, 0xFD};
int pin[] = {8, 10, 2, 3, 4, 5, 6};

void setup() {
  randomSeed(analogRead(A0));
  Serial.begin(115200);
  for (int x = 0; x < 7; x++){
    pinMode(pin[x], OUTPUT);
  }
}

void loop() {
  int a = random(0, 6);

  int stevilka = digit[a];//digit[0];

  for(int x = 0; x < 7;  x++){
    int temp = stevilka & 0x01; // filter r: 0 ali 1
    digitalWrite(pin[x], temp);
    stevilka = stevilka >> 1;
  }
  delay(500);
  for(int x = 0; x < 7;  x++){
    //int temp = stevilka & 0x01; // filter r: 0 ali 1
    digitalWrite(pin[x], LOW);
    //stevilka = stevilka >> 1;
  }
  delay(500);

}