Hi,
I'm using the library felUsbserial (https://www.b4x.com/android/forum/threads/felusbserial-alternative-usb-serial-library.62216/#content) for communication with Arduino.
The communication works fine, but I need to check the Arduino response for each command individually.
My code is:
Sub Enviar
Respuesta=""
usbserial.Write(bc.StringToBytes(txtEnviar.Text & CRLF,"UTF8"))
Do While Respuesta=""
DoEvents
Loop
End Sub
Sub serial_DataAvailable (Buffer() As Byte)
Respuesta=bc.StringFromBytes(Buffer,"UTF8")
End Sub
The problem is when use "DoEvents", the event "serial_DataAvailable" don't raise. Without "DoEvents" the event raise perfect and "Respuesta" gets the data in the Buffer.
Thank you in advance and sorry for my english.
I'm using the library felUsbserial (https://www.b4x.com/android/forum/threads/felusbserial-alternative-usb-serial-library.62216/#content) for communication with Arduino.
The communication works fine, but I need to check the Arduino response for each command individually.
My code is:
Sub Enviar
Respuesta=""
usbserial.Write(bc.StringToBytes(txtEnviar.Text & CRLF,"UTF8"))
Do While Respuesta=""
DoEvents
Loop
End Sub
Sub serial_DataAvailable (Buffer() As Byte)
Respuesta=bc.StringFromBytes(Buffer,"UTF8")
End Sub
The problem is when use "DoEvents", the event "serial_DataAvailable" don't raise. Without "DoEvents" the event raise perfect and "Respuesta" gets the data in the Buffer.
Thank you in advance and sorry for my english.