Adds a function to get the current encoder value.