OH no. Not another instructiables heap of crap!
Sometimes I get so fed up with trying to sort out the rubbish put on that site.
The code is horrendous and almost impossible to follow. I suppose you have no idea what it is doing.
It is a perfect example of write only code and my guess is that it has had zero testing.
Where is the schematic I asked about? Instructables usually miss them out because the authors do not understand electronics.
one pode to the GND and other pole to the ditital pin 0.
That would normally be fine ( but not on pins 0 & 1 ) except the idiot of an author did not enable the internal pull up resistors so that stands no chance of working correctly anyway.
You really should not be playing with this sort of stuff that is way beyond what you can understand.
Find a simpler sketch one that just sends one value. Look at it and try to understand it, then try and expand it.
If you are stuck then look at the code in this project:-http://www.thebox.myzen.co.uk/Hardware/Pendulum.html
It sends note on messages in response to a magnet going over a reed switch.