public static String getAnalogueValuePath(int ain)
            throws InvalidGPIOException {
        try {
            Process find = Runtime.getRuntime().exec(
                    "find " + BASE_DEVICES + " -iname AIN" + ain);
            find.waitFor();
            BufferedReader is = new BufferedReader(new InputStreamReader(
                    find.getInputStream()));
            if (is.ready()) {
                String path = is.readLine();
                if (path != null) {
                    if (is.readLine() != null) {
                        // Found a path, return the first one
                        return path;
                    }
                }
            }
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        throw new InvalidGPIOException("Analogue input " + ain
                + " could not be found");

    }