The code that follows addresses the following requirement:

  • initially, led off
  • when switch turned on, a timer starts and counts 2 seconds
  • after timer expires, turn led on
  • when switch is off, turn LED off

Here is the code:

Leave a Comment