haggai666:
at first i connected it to 5v for a while by mistake, but now it is connected as instructed in the guide (minus on resistor where you need two).
This is incoherent but, if your HC-05 is on a breakout board, it should be powered by 5v and you probably haven't damaged anything.
The code looks like junk, and is for configuration, not communication. You may never need to configure bluetooth, and you surely don't need to at the moment. You might find the following background notes useful
http://homepages.ihug.com.au/~npyner/Arduino/GUIDE_2BT.pdf
http://homepages.ihug.com.au/~npyner/Arduino/BT_2_WAY.ino