I have been working on a number of ways of interfacing with Rune in some kind of portable enclosure using resistive screens, touchpads, etc. I've found that the resistive screens are somewhat difficult to operate, especially scrolling, and touchpads can too easily be triggered when in a bag or pocket. I have followed with great interest the threads here regarding the use of a simple LCD panel to display the currently playing music and hardware buttons to control the interface as a sort of compromise pending the availability of a small (3.5" or less) capacitive screen that works with Rune. So along those lines, I tried the Adafruit PiTFT 2.8" capacitive screen (No. 2423), which comes with 4 buttons supposedly mapped to 4 GPIO pins (17, 22, 23, 27).
So far, I have been able to get an image of RuneAudio on the screen with a Raspberry Pi 2 and Pi 3; however, as expected I have not been able to get the capacitive touch to work. I assume this is because Adafruit embedded the touch drivers in the kernel, and they can't be simply added to Arch.
The screen serves the purpose of displaying what is playing now, as in the excellent thread "LCD display and buttons in Python (tutorial and code)" . But I am having trouble getting the 4 buttons to work. I tried the PeteB's script from , using pin 17, which is supposedly mapped to one of the screen's buttons, but I got the following error:
File "hw_pause_play.py", line 10, in <module>
GPIO.setup(InputPin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
ValueError: The channel sent is invalid on a Raspberry Pi
When I tried pin 22, I got the following message:
hw_pause_play.py:10: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.
GPIO.setup(InputPin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
Traceback (most recent call last):
File "hw_pause_play.py", line 13, in <module>
GPIO.wait_for_edge(InputPin, GPIO.FALLING)
RuntimeError: Error waiting for edge
Also the "Stop" button on the display kept changing color.
When I used pin 7, it seemed like the script was working, but I don't know how to assign specific GPIO pins to the Adafruit buttons.
Can anyone tell me what I am doing wrong?
Thanks,
Rod