Hi, I have JY-MCU bluetooth module which I have connected to arduino duemilanove. I am using Ubuntu 12.04.1 and I am trying communicate via serial port but I cant send data to arduino. I tried using "screen" I typed this command in terminal sudo screen /dev/rfcomm0 9600
I wasnt able to type text. I used bluemoon manager to connect with the model it worked but it dont receives commands. What are the problem?
There is 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
}