DigiAmp+ RPi3 Dietpi Adding Rotary Encoder Help Needed!

Looking for help please! I can’t make any sense of how I add the required files to enable a rotary encoder for volume control. I’m very new to the Rpi so I’m probably missing the obvious.

I have a Rpi3 with IQaudio DigiAMP+ running DietPi. I have installed WiringPi (an option within DietPi, so nice and easy). The instructions at iqaudio (http://www.iqaudio.com/downloads/IQaudIO.pdf) say that I need to use the IQ_rot utility from GitHub - iqaudio/tools: Sample CLI tools for IQaudio products but thats where I get stuck.

I’d really like some detailed step by step instructions for how to complete this, but my google searches keep coming up blank.

Any help gratefully received!



@Gordon_Garrity Perhaps Gordon can assist…but I don’t recall that the volume encoder option works for DigiAMP+. I have a few of them and never noticed that was an option.

Pi-Digiamp+ exposes the gpio needed to add an encoder as a physical volume control. Pin header output in the user guide. (www.iqaudio.com/downloads/IQaudIO.pdf)

Source for encoder code is here.

Note that this will just adjust the local volume, will have no linkage to other room control points.

Val and I are in parallel email thread :slight_smile:
Hope that helps.


Be good if there was a how to do this on your site :smiley:

So, after tons of googling and emails back and forth with Gordon, I have volume control working. Here is how I did it.

1: Log in to dietpi, go to dietpi-software then Software Additional and select Wiringpi, Alsa, Git, and MC, select OK then go to Install and install the selected options.

2: reboot and log back in to dietpi

3: run ‘git clone https://github.com/iqaudio/tools.git’

4: run ‘sudo apt-get install libasound2’

5: run ‘sudo apt-get install libasound2-dev’

6: from the root@DietPi:~# prompt, type ‘mc’ and enter to launch Midnight Commander, double click on /tools and then double click on IQ_rot.c
Come down the page to line 40: #define TRUE 1 and add // at the start of the line, making it //#define TRUE 1
Now do the same for line 41: #define FALSE 0 to //#define FALSE 0
Exit and save

7: from the root@DietPi:~# prompt, type ‘cd tools’ and enter then ‘gcc IQ_rot.c -oIQ_rot -lwiringPi -lasound’ and enter. This should return you to the dietpi prompt with no errors.

8: from the root@DietPi:~# prompt, type ‘sudo /root/tools/IQ_rot&’ and enter and you should get the reply
root@DietPi:~# IQaudIO.com Pi-DAC Volume Control support Rotary Encoder) v1.5 Aug 30th 2015

The rotary encoder should now be working :slight_smile:

9: To make it load the required files after every reboot, create a cron job with ‘@reboot /root/tools/IQ_rot&’ using ‘sudo VISUAL=nano crontab -e’

Hope this may be of help to others!