#Region Project Attributes
#AutoFlushLogs: True
#CheckArrayBounds: True
#StackBufferSize: 500
#End Region
'
Sub Process_Globals
Public Serial1 As Serial 'Serial connection for Debug..
Public Serial2 As SoftwareSerial
Public astream As AsyncStreams
Public timer As Timer
'
End Sub
'
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")'
'
Serial2.Initialize(9600,12,14) 'pin ESP07
astream.Initialize(Serial2.Stream,"astream_newdata","astream_error")
'
timer.Initialize("timer_Tick",2000)
timer.Enabled=True
End Sub
Sub timer_Tick
Log("tick")
Dim msg() As Byte ="hallo"
astream.Write(msg)
End Sub
Sub astream_newdata (Buffer() As Byte) '
Log("from esp:",Buffer)
End Sub
'
Sub astream_error
Log("Serial - No Connection")
End Sub