Private Sub AppStart
Serial1.Initialize(115200)
Log("appstart")
led.Initialize(5,led.MODE_OUTPUT)
timer1.Initialize("timer1_Tick",500)
led.DigitalWrite(True)
If wifi.Connect2("SSID","password") Then
timer1.Enabled=True
Log("Waiting for connection.")
Log("My ip: ", wifi.LocalIp)
Else
Log("Failed to connect to Wifi.")
End If
End Sub
Sub timer1_tick
Dim oldstate,newstate As Boolean
oldstate=led.DigitalRead
newstate=Not(oldstate)
led.DigitalWrite(newstate)
End Sub