My Bluetooth doesn't receive data!

actually i have a problem with mybluetooth

first i can pair with it from my android
i’m using Bluetooth terminal

and it give me double flash every 2 seconds( which means that is connected)
i’m using Bluetooth terminal app from android

and i wrote this code

// Basic Bluetooth sketch HC-05_02
// Connect the HC-05 module and communicate using the serial monitor
//
// The HC-05 defaults to commincation mode when first powered on.
// The default baud rate for communication mode is 9600
//
 
#include <SoftwareSerial.h>
SoftwareSerial BTserial(0, 1); // RX | TX
// Connect the HC-05 TX to Arduino pin 2 RX. 
// Connect the HC-05 RX to Arduino pin 3 TX through a voltage divider.
// 
 
char c = ' ';
 
void setup() 
{
    Serial.begin(9600);
    Serial.println("Arduino is ready");
 
    // HC-05 default serial speed for commincation mode is 9600
    BTserial.begin(9600);  
}
 
void loop()
{
 
    // Keep reading from HC-05 and send to Arduino Serial Monitor
    if (BTserial.available())
    {  
        c = BTserial.read();
        Serial.write(c);
        Serial.println(c); 
        BTserial.write(c); 
    }
 
    // Keep reading from Arduino Serial Monitor and send to HC-05
    if (Serial.available())
    {
        c =  Serial.read();
        BTserial.write(c); 
        Serial.println(c); 
    }
 
}

okay, when i send data from the serial monitor via bluetooth to the Android app, i receive the data

but when i send data from the application to my arduino, i don’t receive the data on the Serial monitor.

so what could be the problem?

SoftwareSerial BTserial(0, 1); // RX | TX

You can NOT do SoftwareSerial on the hardware serial pins while using them as hardware serial pins. Get over it.

first, thank you sir

but i used this code also ( to turn on/off the Led of pin 13 from the android app via bluetooth)
with ArduDroid app

int ledPin=13;
int state=0;
int flag=0;
void setup()
{
Serial.begin(9600);
pinMode(ledPin,OUTPUT);
digitalWrite(ledPin,LOW);

}

void loop(){
if (Serial.available()>0){
state=Serial.read();
flag=0;
}
if (state=='0'){
digitalWrite(ledPin,LOW);
if (flag==0){
Serial.println("LED: OFF");
flag=1;
}
}
if (state=='1'){
digitalWrite(ledPin,HIGH);
if (flag==0){
Serial.println("LED: ON");
flag=1;
}
}
}

and it did work also!
i just wanna to understand why in order to fix the problem

and it did work also!
i just wanna to understand why in order to fix the problem

It worked. You want to understand why so you can fix what problem?

sorry!
it didn't work!

How is your bluetooth device connected to the Arduino? It should be connected to two pins other than 0 and 1, and you should use SoftwareSerial to talk to it. Leave the hardware serial pins available for debugging the code. Add some debugging statements.

i try it, but still with the same problem

anw
Bluetooth–> ARduino
VCC → 5V
GND → GND
TX → 2
RX- → 3 ( voltage divider)

#include <SoftwareSerial.h>
SoftwareSerial BTserial(2, 3);

i saw right now that when i send data from the serial monitor to the android, the 2 leds of the arduino (RX and TX) flash for just one time

but when i send form android, i dont receive data and the leds ( RX and TX) stay off

i saw right now that when i send data from the serial monitor to the android, the 2 leds of the arduino (RX and TX) flash for just one time

You are NOT sending data from the Serial Monitor app to the droid. You are sending it to the Arduino that MAY be sending it to the droid.

but when i send form android, i dont receive data and the leds ( RX and TX) stay off

The LEDs stay off because they are controlled by the USB to serial converter, not by the Arduino chip.

Perhaps the fine folks at http://snippets-r-us.com can help with your snippets.