Sub Process_Globals
Public Serial1 As Serial
Private astream As AsyncStreams
Private softserial As SoftwareSerial
Private Timer1 As Timer
End Sub
Private Sub AppStart
Serial1.Initialize(9600)
Log("appstart")
'RX=10, TX=11
softserial.Initialize(9600, 10, 11)
astream.Initialize(softserial.Stream, "astream_newdata", Null)
'
Timer1.Initialize("Timer1_Tick", 2000)
Timer1.Enabled = True
End Sub
'Send a string to the ESP
Sub timer1_tick
Dim str As String = "Hello"
astream.Write(str.GetBytes)
End Sub
'Handle data received from the ESP
Sub astream_newdata (Buffer() As Byte)
Log("NewData from ESP:",Buffer)
End Sub