hi i have problems with communicating between phone and ArduinoBT.
my sketch is this:
char serial_val;
void loop()
{
if(serial_val=='a')
Serial.print("first");
if(serial_val=='b')
Serial.print("second");
}
my code on phone is this:
os=conn.openOutputStream();
os.write('a');
is=conn.openInputStream();
byte buffer[] = new byte[30];
while(true)
{
is.read(buffer);
instr = new String(buffer);
System.out.println(instr);
tracerForm.append(new StringItem(null, instr));
}
maybe is the problem that if i send 'a' arduino dont understand it because i tried to write ascii 97 or other things but nothing worked.
please give me tips