#init le CRTL+C
trap exit_propre INT

exit_propre()
{
	echo 137 > /sys/class/gpio/unexport
	echo 138 > /sys/class/gpio/unexport
	echo 139 > /sys/class/gpio/unexport	
	exit 0
}

#EXECU de ton code
echo 137 > /sys/class/gpio/export
echo 138 > /sys/class/gpio/export
echo 139 > /sys/class/gpio/export
echo in> /sys/class/gpio/pioE9/direction
echo in> /sys/class/gpio/pioE10/direction
echo in> /sys/class/gpio/pioE11/direction
echo "pins"
echo "G D B"
while true
do
    joyG=$(cat /sys/class/gpio/pioE9/value)
    joyD=$(cat /sys/class/gpio/pioE10/value)
    joyB=$(cat /sys/class/gpio/pioE11/value)
  
    echo $joyG $joyD $joyB
    sleep 0.1
done
