still not working with IOIO UART Receiving
'Activity module
Sub Process_Globals
Dim TextReader1 As TextReader
Dim TextWriter1 As TextWriter
Dim Timer1 As Timer
Dim connected As Boolean
Dim YOYO As IOIO
Dim led As DigitalOutput
Dim pin9 As DigitalInput
Dim uart1 As Uart
Dim ledflag As Boolean
Dim AStreams As AsyncStreams
End Sub
Sub Globals
Dim txtLog As EditText
Dim txtSend As EditText
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
Timer1.Initialize("Timer1", 2000)
YOYO.Initialize
YOYO.WaitForConnect()
led = YOYO.OpenDigitalOutput( 0,led.OP_NORMAL ,True) ' Enable LED_PIN for output
uart1= YOYO.OpenUart(9,uart1.IP_FLOATING,4,uart1.OP_NORMAL,9600,uart1.PARITY_NONE,uart1.STOPBIT_ONE)
If uart1.IsInitialized Then
AStreams.Initialize(uart1.InputStream, uart1.OutputStream, "AStreams")
timer1.Enabled = True
connected = True
End If
End If
Activity.LoadLayout("1")
End Sub
Sub Activity_Resume
End Sub
Sub Timer1_Tick
If ledflag= True Then
ledflag=False
Else
ledflag=True
End If
led.Write(ledflag)
If connected Then
txtSend.Text="Hello"
If AStreams.IsInitialized = False Then Return
If txtSend.Text.Length > 0 Then
Dim buffer() As Byte
buffer = txtSend.Text.GetBytes("UTF8")
AStreams.Write(buffer)
txtSend.SelectAll
End If
End If
End Sub
Sub AStreams_NewData (Buffer() As Byte)
Dim msg As String
msg = BytesToString(Buffer, 0, Buffer.Length, "UTF8")
txtLog.Text = txtLog.Text & msg
End Sub
Sub AStreams_Error
ToastMessageShow(LastException.Message, True)
End Sub
I can send "hello" to pc with an max232 level converter, but I just can't receive any byte when I send yest from PC to IOIO board. can you help if I missed something?