The ghost LED

Modify the code of the last module so that:

  • Instead of turning the LEDs ON one by one, they should turn OFF one by one. Starting with all LEDs ON, each time exactly one LED should be off and then the next one. Ergo, the ghost LED.
  • When finishing the loop (5th LED), the ghost LED moves backwards. So the ghost's path goes 1-2-3-4-5-4-3-2-1-2-3...
  • The speed of the ghost starts at a fixed delay time of 3 seconds. Slowly, it accelerates until it becomes invisible. Make sure that all the above ghost features are observable before that happens!
Submit three sketches as .ino files, with comments, adding one feature at a time.
  • The ghost appears.
  • The ghost moves backwards.
  • The ghost accelerates and disappears.