serial communication with bluetooth hc-05 not working

i am using this guide: http://www.carobot.cc/how-to/hc-05-guide/
my goal is communicating with the hc-05 as it says in the guide.
whats happening now is the bluetooth isnt getting/responding to the messages i send. in addition to the messages in the code, im sending messages in the adruino IDE like it says in the guide (sending "AT" should return "ok"), but no response.
i know its on, and i can "pair" with it with my phone, but cant "connect" like usual bluetooth stuff. i also tried using a bluetooth terminal android app, but still i didnt get any answer.

heres the code i have uploaded:
#include <SoftwareSerial.h>
SoftwareSerial BT(17, 16); //these are R/T pins in arduino mega
void setup()
{
BT.begin(9600);
Serial.begin(9600);
}
void loop()
{
BT.write("AT
BT.print("AT");//trying
if (BT.available()){
Serial.println("hc-05 got the message!");
Serial.write(BT.read());
}
if (Serial.available()){
BT.print(Serial.read());
}
}
i will appreciate any sort of help.

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

Have a look at the examples in Serial Input Basics - simple reliable ways to receive data.

...R

SoftwareSerial BT(17, 16); //these are R/T pins in arduino mega

Only a fool does software serial on hardware serial pins.

PaulS:
Only a fool does software serial on hardware serial pins.

Or, as i suspect is the case here, someone who doesn't know or appreciate the difference. That's not being foolish, it's about ignorance, and there are ways to overcome ignorance without telling someone she or he is a fool.

You're the fool for doing that.

The message from Replies #3 and #4 is that you can use Serial2 when using the HardwareSerial pins 16 and 17 on your Mega and it will perform very much better than using SoftwareSerial

SoftwareSerial only makes sense on an Uno or Nano because they only have 1 HardwareSerial port.

...R