Which system do you use? Android, Ubuntu, OOWOW or others?
Ubuntu
Which version of system do you use? Khadas official images, self built images, or others?
Edge2 Ubuntu 22.04 Linux 5.10 V1.6.2-240110 Release
Please describe your issue below:
I encountered a weird interaction between the TS050 touchscreen and the IO pins of the Edge2 IO module: whenever I touch the screen, this also triggers a signal on the pins connected to a rotary encoder (eg. PIN_A=113, PIN_B=24, PIN_SWITCH=23). Is it expected or is it a bug??? Thanks!
The problem occurs either when running Ubuntu Desktop or Server mode (sudo systemctl isolate multi-user.target) with a simple switch connected to pin 23 on the Edge2 IO module. I am running the following bash file to monitor the switch status:
#!/bin/bash
GPIO_PIN=23
echo "$GPIO_PIN" > /sys/class/gpio/export
echo "in" > "/sys/class/gpio/gpio$GPIO_PIN/direction"
PREV_VALUE=0
while true; do
CURRENT_VALUE=$(cat "/sys/class/gpio/gpio$GPIO_PIN/value")
if [ "$CURRENT_VALUE" -ne "$PREV_VALUE" ]; then
if [ "$CURRENT_VALUE" -eq 1 ]; then
echo "Pin value changed from 0 to 1"
else
echo "Pin value changed from 1 to 0"
fi
PREV_VALUE="$CURRENT_VALUE"
fi
sleep 0.01
done
The pin output changes its value each time the TS050 display is touched as shown by the output below:
sudo ./test_button.sh
Pin value changed from 0 to 1
Pin value changed from 1 to 0
Pin value changed from 0 to 1
Pin value changed from 1 to 0
Pin value changed from 0 to 1
Pin value changed from 1 to 0
Pin value changed from 0 to 1
Pin value changed from 1 to 0
Pin value changed from 0 to 1
Pin value changed from 1 to 0
Pin value changed from 0 to 1
Here is the info about the system installed on my Edge2:
Thanks @Jacobe, you are right I just needed to use some other pins. So in short, GPIO Num 23 & 24 are already used by the display i2c if a TS050 is connected.