protected void writeFile(String fileName, String value) throws RuntimeException {
		try {
			// check for permission
			FileOutputStream fos = new FileOutputStream(fileName);
			fos.write(value.getBytes());
			fos.close();
		} catch (FileNotFoundException fnfe) {
		    throw new RuntimeException("Permission denied to GPIO file: " + fnfe.getMessage());
		} catch (SecurityException e) {
		    throw new RuntimeException("Permission denied to GPIO file: " + e.getMessage());
		} catch (IOException e) {
            System.out.println("GPIO is already exported, continuing");
        }
	}