Your son will love it!
I did something similar back in the 1960s - without the luxury of a processor or LEDs !
Work on the separate parts of code before you glue them together, then you’ll understand how each one works.
Putting them together isn’t hard, but you need to understand the bits.
Easily achieved with an Arduino as a learning project.
Enjoy.