Other [Things] Rotary Encoder for Android Things

Hypnos

Active Member
Licensed User
Longtime User



Currently, I'm using a timer with the following code, but I can't rotate it too fast, any better way ?
B4X:
Sub Timer_Tick

Dim aState As Boolean
aState = PIN17.Value

If aState <> aLastState Then
   If PIN18.Value <> aLastState Then
       R_Value = R_Value +1
   Else
       R_Value = R_Value - 1
   End If
End If

aLastState =aState

End Sub
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…