I would like to make use of the Rotary Encoder on my next project on Android Things running on pi3, am I need a library or anyone can give me some example code on B4A please?
I would like to make use of the Rotary Encoder on my next project on Android Things running on pi3, am I need a library or anyone can give me some example code on B4A please?
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