The code I'm using is here
Some pictures of my setup are here
There's a circle on the first picture where the led is blinking and the ticking noise is coming from. 'D8' is written under it.