#Region Project Attributes
#AutoFlushLogs: True
#CheckArrayBounds: True
#StackBufferSize: 300
#End Region
Sub Process_Globals
Public Serial1 As Serial
Dim tm As Timer
Private buttonin, buttonout As Pin
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
buttonin.Initialize(34, buttonin.MODE_OUTPUT)
buttonout.Initialize(35, buttonout.MODE_INPUT)
tm.Initialize("tm_Tick", 1000) '1000ms = 1 second
buttonout.AddListener("buttonout_StateChanged")
buttonout.DigitalWrite(False)
'Enable trigger with Timer interval
End Sub
Private Sub buttonout_StateChanged(State As Boolean)
Delay (300)
Log(State)
tm.Enabled = State
If State = True Then
Log("Button Pressed")
Else
Log("Button Not Pressed")
End If
End Sub
Sub tm_Tick
Log(Millis)
End Sub