UNO & bluetooth problem

hello,
I am newbie in electronic and arduino.
I am facing this problem for more than 1 week.

I hope someone can give me ideas on how to move forward.

My plan:
Using PC communicate with arduino UNO pin Tx & Rx via bluetooth.
Everything is good,
I can make use of hyperterminal to receive a looping counter value from arduino program.

But .....
I cannot send keystroke to arduino UNO. Just like a tutorial from arduino.cc
http://arduino.cc/playground/Learning/Tutorial01/

I try to type 'H' to turn on/off the LED on arduino UNO.

I am going to narrow down the problem.
Is it a bluetooth module problem?
Is it a Rx pin problem of UNO?

Pls. give me some advise.
How about this?
If I remove the bluetooth module, like using a USB<--> TTL cable,
connect the Tx pin to UNO Rx, Rx pin to UNO Tx pin.
Then, using hyperterminal to connect this com port.
Can i test the TxRx function of UNO?
Or, any other method that i can test on it?
Thank you.

I am going to narrow down the problem.
Is it a bluetooth module problem?
Is it a Rx pin problem of UNO?

More likely, the problem is the code you are running. Try looking at line 145.

Or post your code, so we can look at it.

here is my code :

Wiring code

char val; // variable to receive data from the serial port
int ledpin = 8; // LED connected to pin 48 (on-board LED)

void setup() {

pinMode(ledpin, OUTPUT); // pin 48 (on-board LED) as OUTPUT
Serial.begin(9600); // start serial communication at 9600bps

}

void loop() {

if( Serial.available() ) // if data is available to read
{
val = Serial.read(); // read it and store it in 'val'
}
if( val == 'H' ) // if 'H' was received
{
digitalWrite(ledpin, HIGH); // turn ON the LED
} else {
digitalWrite(ledpin, LOW); // otherwise turn it OFF
}
delay(100); // wait 100ms for next reading

}

Pls mind some BT modules have got "sleep" mode implemented (as mine did) - after 6secs of inactivity they go to sleep, waking up takes some time, so your characters are lost :frowning:

thanks to all

I finally re-config the baudrate of the bluetooth module. (Actually, i did it b4 but not success)

And problem solved.