Go Down

Topic: HC-06 Bluetooth (Read 651 times) previous topic - next topic

evadeltor

Hi!
I'm having a weird problem
I can do the following:
SENSOR - ARDUINO -HC06 -APP INVENTOR - SEE THE VALUE IN MY APP
But I can't do:
WRITE A VALUE IN THE APP/PRESS A BUTTON- APP INVENTOR - HC06 - ARDUINO - SERIAL
I mean I've trided the silder, the text box, a button but anything works
It's like the Serial.available() always return 0 even I press the button.
An example code for a button would be this one:

Code: [Select]

int valor;

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

void loop(){
  if (Serial.available()){
    //doesn't get inside here
    //it's always 0/-1
   valor = Serial.read();
   Serial.println(valor);
   if (valor == 'A'){
    Serial.println("hua");
   }
   if (valor == 'B'){
    Serial.println("aueu");
   }
}
}

Nick_Pyner

Maybe it's just the way you spell bluetooth. Have you tried using a standard Android terminal? That might tell you where the problem lies.

Go Up