Extracted encoder_value from the switch case. :)
generalized the encoder reader to read 4 encoders.