Sequence with locking relay (edit with code)

Hi, i try to create a sequence with a button sequence and a lock.
I found a way to do it with multiple buttons and a sequence (eg. 1-2-3-4), but i want the sequence to be three times the same button. The relay needs to release the latch for 10 seconds, then goes back to lock position.
The sequence may take 25 seconds to complete.

Can someone help me? (sorry for my english, it is not my first language!

Thank you.
Is it possible to start with this code:

int key = 0;
int Solved = 0;
int count = 2;
char code[8] = "ttabcd";  //first 2 chars are space holders only
int keyCounter[6] = {0, 0, 0, 0} ; // Set key flag

void setup() {

  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(13, OUTPUT);


  for (int i = 2; i <= 6; i++)
  {
    pinMode(i, INPUT);   // for D2 and up
  }
}

void loop()
{

  if (Solved == 0)
  {
    while (count != 6)
    {
      for (int i = 2; i <= 6; i++)
      {
        key = digitalRead(i);
        delay(40);

        if (key == LOW && keyCounter[i] == 1) {
          keyCounter[i] = 0;
          break;
        }
        if (key == HIGH && keyCounter[i] == 0)
        {
          digitalWrite(8, HIGH);
          delay(20);
          digitalWrite(8, LOW);
          delay(330);


          switch (i)
          {
            case 1:
              if (count == 2 && code[i] == 'a')
              {
                count = count + 1;

              }

              else
              {
                count = 2;
              }
              keyCounter[i] = 1;
              break;

            case 2:
              if (count == 3 && code[i] == 'c')
              {
                count = count + 1;

              }
              else
              {
                count = 2;
              }
              keyCounter[i] = 1;
              break;
            case 3:
              if (count == 4 && code[i] == 'c')
              {
                count = count + 1;

              }
              else
              {
                count = 2;
              }
              keyCounter[i] = 1;
              break;

            case 4:
              if (count == 5 && code[i] == 'b')
              {
                count = count + 1;

              }
              else
              {
                count = 2;
              }
              keyCounter[i] = 1;
              break;


          }
        }
      }
    }
  }
  if (count == 6)
  {
    digitalWrite(9, HIGH);
    count = 2;
    delay(1000);
    digitalWrite(9, LOW);
    Solved = 0;

  }

  else
  {

    Solved = 0;

  }
}

Your code is needed. Check how to attach code, using code tags.

The same buttom three times, understood. But, are there required times held down and required times released? You need to define the pattern you want.

Also, please show what work you have already done by posting your current code using code tags, the </> icon.

i'm a newbie on arduino.

I tried to modify a code found on the internet, but it's not working at all...
I need to start from a white page. I'll be doing it and post it as soon as i can.
Thank you :slight_smile: