bluetooth send wrong output?

hey there,

i try to setup a hc-06 bluetooth modul. For this i connected the RXD(bt modul) to TX(arduino) and the TXD(bt modul) to RX (arduino). The other two pins are in 5V and gnd.

in the arduino software i just tried to print the input value. So it the code looks like this:

int state;

void setup() {
Serial.begin(9600);
}

void loop() {
if (Serial.available()){
state = Serial.read();
}

Serial.println(state);
}

Now the problem is that the bluetooth modul outputs only the number 35. So the state is always 35... no metter what i send to the modul.

Can you please help me?

Thank yoU!

Try this

/* This is a simple test for two way traffic via bluetooth 
   but you can try it first using the USB cable to the serial 
   monitor without the bluetooth module connected.
   
   Note that some bluetooth modules come set to a different baud rate.
   This means you need to alter the command
                Serial.begin(9600) accordingly
   Same goes for the setting in the bottom right corner on the 
   serial monitor */ 
String readString;
char c;
void setup()
{
    pinMode(0, INPUT_PULLUP);// only needed for  JY-MCUY v1.06?
    Serial.begin(9600);
    Serial.println("OK then, you first, say something.....");
    Serial.println("Go on, type something in the space above");
    Serial.println(" and hit Send or Enter,");
    Serial.println("then I will repeat it!");
    Serial.println("");
}

void loop() {
    while (Serial.available())     //Check if there is an available byte to read
  {
    delay(3);                        //Delay added to make thing stable 
    c = Serial.read();             //Conduct a serial read
    readString += c;               //build up the string
  }                                     // end while
  if (readString.length() >0) 
  {  
    Serial.write(c);  
   readString="";  
  }                                    // end if
}

note the Serial.write(c);