you can write to gpios by first chmod'ing 666 to the folders and then to
individual attributes.
On Wednesday, July 1, 2015 at 8:32:48 PM UTC+5:30, Brendan Merna wrote:
>
>
> I'm trying to manipulate my GPIOs using C code and running into
> "Permission Denied" when running my code and opening the file
> /sys/class/gpio/export. I'm using nano editor, compiling on the Beaglebone
> with gcc, and I'm under root user.
>
> I would like to do this, so I can set directions and values for the GPIOs
> with my code. I've heard this might be a problem with user and kernel space
> conflicting. I know there are library calls in python and other languages
> to do this that work. Does anyone know what this problem might be and our
> their alternate calls I can do in C?
>
> I tried to just include the necessary parts of the code.
> Code:
> #include<fcntl.h>
> static const char *GPIO_PATH = "/sys/class/gpio/export";
> int main(){
> int file;
> if ((file = open(GPIO_PATH, O_RDWR))<0){
> perror("GPIO: Can't open the device.");
> return -1;
> }
> return 0;
> }
>
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/beagleboard/fe241815-54f6-4905-a871-e65746420ae4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.