Sending text join to Arduino

hi everyone.... i have the next problem---
i create an app where i whant to send a string than contains symbols and numbers
sample : <12,5,11,20>

the thing is that when it's recived on arduino, on the monitor don't show me the string<12,5,11,20>... it shows me the characters separadtely:
-> <
-> 1
-> 2
-> ,
-> 5
-> ,
-> etc...

this is what i have on app inventor
image
image

on arduino

String xxxx;
char DATO = 0; 

void setup(){

  Serial.begin(9600);

  miBT.begin(38400);    

}

void loop(){
  DATO = miBT.read();  

xxxx = String(DATO);

Serial.println(xxxx);

  
delay(1000);

}

any idea why it's that???
thanks..

Serial.print(xxxx);

1 Like

how it shloud be?????.. maybe i didn't explain well...
what i need it's that the data send from bluettoth and read on the monitor is for the value to be:

17:40:18.270 -> <12,5,11,20>

BUT what's appear it's

17:40:18.270 -> <
17:40:18.270 -> 1
17:40:18.317 -> 2
17:40:18.317 -> ,
17:40:19.250 -> 5
17:40:19.296 -> ,
17:40:19.296 -> 1
.... etc...

Use

char end_char = '>';
String DATO;

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

void loop() { 
  if(miBT.available()) {
    DATO = miBT.readStringUntil(end_char);
    Serial.println(DATO);
  }
}

What terminals do you have connected the Bluetooth module to the Arduino?

1 Like

thanks a lot--- i'll try and comment..
the terminals i use are :

SoftwareSerial miBT(11, 12); // pin 11 as RX, pin 12 as TX

U R GREAT @Juan_Antonio !!!! :ok_hand: :clap: :clap: :clap: :clap:
readStringUntil DID THE TRICK

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