Raspberry Pi and GPIO

Michael Doub mikedoub at gmail.com
Thu Oct 9 14:43:20 EDT 2014


I think that I have now confirmed that it is a permission issue.   I added a “sudo” in front of the “echo” command.  Now everything seems to be working.

I still have the question about how to give livecode the correct permissions to access this files as it would seem more logical to use to do direct IO to the files rather that to be forced to use a shell command.

I am running as the default pi user.   Should this user have different permissions?  If so how do you grant them?

Regards,
  Mike


On Oct 9, 2014, at 2:21 PM, Michael Doub <mikedoub at gmail.com> wrote:

> I am looking for some help from some of you with unix/raspberry pi experience.
> 
> I have think that I have installed 7.0 rc 1 on my raspberry pi B+ properly.   I am trying to figure out how to play with the GPIO’s.   
> 
> I am am able to execute the following to set up the IO
> 
>        put shell("echo 12 > /sys/class/gpio/export") into dummy
> 
> dummy is empty,   However the next statement:
> 
>        put shell("echo out > /sys/class/gpio/gpio12/direction") into dummy
> 
> 
> dummy contains the error message:
> 
>       bin/sh: cannot create /sys/class/gpio/gpio12/direction:  Directory nonexistent 
> 
> When I use the terminal, I can see that the directory does exist and I am able to modify the contents to both set the IO direction and sucessfully turn the LED on and off.   
> 
> Could it be that I do not have the permission to create directories and modify files from livecode?   How can I check this from livecode and fix it?  …. assuming this is in fact a permission issue.
> 
> Thanks,
>   Mike
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list