Sub Process_Globals
Public Serial1 As Serial
Private counter As ULong
Public dp As D1Pins
Public blink As Pin
Public Timer1 As Timer
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
blink.Initialize(dp.D4, blink.MODE_OUTPUT)
Timer1.Initialize("Timer1_Tick", 5000)
Timer1.Enabled = True 'don't forget to enable it
AddLooper("Looper1")
End Sub
Sub Looper1
counter = counter + 1
If counter Mod 100000 = 0 Then
Log("Took me ", Millis, " milliseconds to count to ", counter)
Log(counter / Millis, " loops per milliseconds")
End If
End Sub
Private Sub Timer1_Tick
Dim currentState As Boolean = blink.DigitalRead
'Log("CurrentState: ", currentState)
Dim NewState As Boolean = Not(currentState)
' Log("NewState: ", NewState)
blink.DigitalWrite(NewState)
End Sub