Hi,
I am new in B4A. I need to send command and read ID from a RFID reader that is based on TTL-level serial communications.I use a IOIO board from sparkfun, and imported lib from this forum. so far, I can get the LED on/off and can sent command to RFID, but I don't know how to read data back from UART.
below are some lines from my project.
'define pin and open uart port.
UART1= YOYO.OpenUart(4, uart1.IP_FLOATING,5,uart1.OP_NORMAL,115200,uart1.PARITY_NONE,uart1.STOPBIT_ONE)
'using textreader to read buffer
TextReader1.Initialize(UART1.InputStream)
TextWriter1.Initialize(UART1OutputStream)
'using a timer to check if data arrived in 20msec
If TextReader1.Ready Then 'check if there is any data waiting to be read
Label1.Text = TextReader1.ReadLine & CRLF
End If
when the RFID send back data to IOIO and the program hanged for a about 30 second, and an error message pump up to force terminate the program.
I googled the entired web and searched this forum for about 2 full days, and has no luck, can someone teach me how to deal with UART with IOIO in B4A. or can someone tell me if is it possible to read data back from IOIO with B4A
Sample code and drawing will be very much appeciated.
THANK You!
I am new in B4A. I need to send command and read ID from a RFID reader that is based on TTL-level serial communications.I use a IOIO board from sparkfun, and imported lib from this forum. so far, I can get the LED on/off and can sent command to RFID, but I don't know how to read data back from UART.
below are some lines from my project.
'define pin and open uart port.
UART1= YOYO.OpenUart(4, uart1.IP_FLOATING,5,uart1.OP_NORMAL,115200,uart1.PARITY_NONE,uart1.STOPBIT_ONE)
'using textreader to read buffer
TextReader1.Initialize(UART1.InputStream)
TextWriter1.Initialize(UART1OutputStream)
'using a timer to check if data arrived in 20msec
If TextReader1.Ready Then 'check if there is any data waiting to be read
Label1.Text = TextReader1.ReadLine & CRLF
End If
when the RFID send back data to IOIO and the program hanged for a about 30 second, and an error message pump up to force terminate the program.
I googled the entired web and searched this forum for about 2 full days, and has no luck, can someone teach me how to deal with UART with IOIO in B4A. or can someone tell me if is it possible to read data back from IOIO with B4A
Sample code and drawing will be very much appeciated.
THANK You!