Hello. Please tell me, when you use the code get the error. What could be 
the reason? The file exists:/sys/class/gpio/gpio60/value

public static boolean value(int pin, int val){
OutputStream os = null;
try {
   os = new FileOutputStream("/sys/class/gpio/gpio"+pin+"/value");
   String s = ""+val;
os.write(s.getBytes(), 0, s.length());      //line 107
os.flush();
return new File("/sys/class/gpio/gpio"+pin+"/value").exists();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally {
if(os!=null)
try {
os.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return false;
}

Exception:
java.io.IOException: Operation not permitted
        at java.io.FileOutputStream.writeBytes(Native Method)
        at java.io.FileOutputStream.write(FileOutputStream.java:345)
        at serial.GPIO.value(GPIO.java:107) 


-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to