Maximite 2: How to make switch trigger only once when pressed


Author Message
Tinine
Guru

Joined: 30/03/2016
Location: United Kingdom
Posts: 1646
Posted: 05:37pm 02 Dec 2020      

If I understand the requirements, I would do something like:



Do

If [button input] Then

 Select Case DbChk
   Case 0
     DbTmr = Timer + 100
     DbChk = 1
   Case 1
     If Timer > DbTmr Then
       var = var +1
       DbChk =2
     End if
   Case 2 'let go of the button dammit
 End Select

Else
 DbChk = 0
End if

Loop