Sending numerical values via bluetooth HC05

So the value will be read until the function hits a no-digit - in your case, \n

1 Like

Another possibility to receive texts or numbers.

char end_char = '\n';
String texto;

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

void loop() { 
  if(Serial.available()) {
    texto = Serial.readStringUntil(end_char);
    Serial.println(texto);
  }
}
2 Likes

So just to clarify, the app sends my inputs as ASCII values to my serial in my arduino program. Then the Serial.parseInt() function converts it back to their integers until it reaches '/n' which signals the end of that integer?

That is our expectation, given the Arduino description of the function. The proof of that pudding is in the eating and it is working for you now?

Right, it works now. Thank you so much.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.