Problem with connection to bluetooth
in
Integration and Hardware
•
1 month ago
i use linux and i want to connect my Processing program with the bluetooth connected to my arduino uno.
i have used this program to Arduino and it works with a mobile phone:
i have used this program to Arduino and it works with a mobile phone:
- byte dada;
void setup(){
pinMode(13,OUTPUT);
Serial.begin(9600);
delay(50);
Serial.println("Conectado");
}
void loop() {
if(Serial.available()){
dada = Serial.read();
switch(dada){
case '0':
digitalWrite(13,LOW);
delay(500);
Serial.println("Led off");
break;
case '1':
digitalWrite(13,HIGH);
delay(500);
Serial.println("Led on");
break;
default:
delay(500);
Serial.print(dada);
Serial.println(" no es una orden valida. Introduzca 0 o 1");
}
}
}
the problem is that i can't connect it from my Processing program. i know that i have it connected to "/dev/rfcomm0" but i have putted this on the program: "robot = new Serial(this,Serial.list()[0],9600);" and this: robot = new Serial(this,"/dev/rfcomm0",9600); and it doesn't work
PD.: it work's well with the cable connected to arduino instead of the bluetooth
1