Automated Boom Gate

Good day,

I am fairly new to Arduino development, but I do code in C# so it is fairly familiar to me.

I am really having a hard time to develop a simple mechanism. Let me quickly explain it to you:

It is an Automated boom gate. This is how it works:

  1. A button is pressed to open the boom (rotates 90 to lift the boom)

  2. 10 seconds later the boom gate must drop down (rotate back to 0 to drop the boom )

  3. There is a loop sensor on the ground ( Infront of the gate under the boom) that detects if a vehicle is over it. If there is a vehicle, the boom must stay up, even after the 10 seconds have expired.

  4. As soon as the vehicle passed over the loop and drive past the boom gate, the gate must close 3 seconds later.

A few things I did manage to do:

I have figured out a timer (not delay)

I have figured out how to only trigger an action once while digital pin is HIGH

what I have not figured out is how to put them all together to work as above.

Can anyone assist me with this please?