#Region Project Attributes
#AutoFlushLogs: True
#CheckArrayBounds: True
#StackBufferSize: 300
#End Region
Sub Process_Globals
Public Serial1 As Serial
Public WiFi As ESP8266WiFi
Public astream As AsyncStreams
Public server As WiFiServerSocket
Public bc As ByteConverter
Public PinA0 As Pin
Public timer1 As Timer
End Sub
Sub AppStart
Serial1.Initialize(115200)
Log(CRLF, "App started")
PinA0.Initialize(PinA0.A0, PinA0.MODE_INPUT)
WiFi.Connect2("*******", "*******")
server.Initialize(12000, "server_newnonnection")
server.Listen
timer1.Initialize("myTickSub", 1000)
timer1.Enabled = True
End Sub
Sub myTickSub
astream.Write(Array As Byte(PinA0.AnalogRead))
End Sub
Sub server_newnonnection (NewSocket As WiFiSocket)
astream.Initialize(NewSocket.Stream, "astream_NewData", "astream_Error")
End Sub
Sub astream_NewData (Buffer() As Byte)
End Sub
Sub astream_Error
End Sub