Countdown timer that triggers a set of LEDs to pulse/fade

I am doing a Major Design Project for year 12 and was just wondering if my project is possible:

  • When you flick a switch to the on position, it starts a countdown timer.
  • After, say 20 minutes, the timer is complete, and it triggers some LEDs to flash/pulse for about 20 seconds.
  • The timer then resets and does this loop until you turn the switch off.

I have basic knowledge about this and any assistance as to how to approach this, if it is at all possible, would be greatly appreciated!

Sure, here's a starting point for you:

void loop(){
if ((digitalRead(3) == HIGH) && (timerRunningFlag == 0) ){
startTime = millis();
timerRunningFlag = 1;
}
if (timerRunningFlag == 1){
currentTime = millis();
if ((currentTime - startTime) >= duration){
timerRunningFlag = 0;
// 20 minutes passed do other stuff
}
}
}

Fill in global variables, setup(), etc. All time variables are unsigned long.