Volumio 2 plugin to configure two simple rotary encoders.
- SSH into server
- Execute the below command:
sudo wget -O volumio_install_from_zip.sh https://raw.githubusercontent.com/Saiyato/volumio-plugin-helper/master/volumio_install_from_zip.sh
This will download the installation script.
- Execute the script (DO NOT USE sudo!) you've just downloaded using the below command:
sh volumio_install_from_zip.sh Saiyato volumio-rotary-encoder-plugin
You can use this install script for any plugin (if they are hosted separately), just add $1 = author and $2 = repository.
- SSH into server
- Execute the below command:
sudo wget -O volumio_installer.sh https://raw.githubusercontent.com/Saiyato/volumio-rotary-encoder-plugin/master/volumio_installer.sh
This will download the installation script.
- Execute the script (DO NOT USE sudo!) you've just downloaded using the below command:
sh volumio_installer.sh
- Connect your rotary encoder(s) and write down the pins you have used
- CLK = pin A
- DT = pin B
The rest of the pins is self explanatory.
- Install the plugin
- Configure your encoder(s) using the pins you wrote down.
- Configure CLK to 0 (zero) to disable the encoder
- Configure SW to 0 (zero) to disable the (push) button on the encoder
- Choose your logic (KY040 or gray coding)
Source: http://www.stuffaboutcode.com/2015/05/raspberry-pi-and-ky040-rotary-encoder.html
Should you encounter any problems with the encoder try the following:
- Add HW (hardware) debouncing; I've ordered 0.1uF capacitors to place between CLK and GND and/or DT and GND
- Try other rotary logic; I've tried to minimize the amount of double reads for my KY040 function, but the default gray coding should work too.
I'd advise to use HW debouncing as most people seem to have solved their problems using that solution.