Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Public Serial1 As Serial
Private wifi As ESP8266WiFi
Private udp As WiFiUDP
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Delay(3000)
Log("AppStart")
Log("Connect2: ", wifi.Connect2("MY_SSID","MY_KEY"))
Delay(1000)
Log("BeginPacket: ", udp.BeginPacket("MY_IP".GetBytes, 8888))
Log("Write: ", udp.Write("Hallo".GetBytes))
Log("SendPacket: ", udp.SendPacket)
Delay(1000)
udp.Close
Log("Closed!")
End Sub