Raspberry Pi GPIO

Richard Gaskin ambassador at fourthworld.com
Fri Jun 10 19:26:28 CEST 2016


Earlier I wrote:

 > What is "the file method"?  How do I treat GPIO connections as file
 > paths?  Somewhere in /proc?
 >
 > Earlier you wrote:
 >
 >     Look at the comments in the library it self for how to solve
 >     the Accessing the GPIO (of a raspberry pi) without "sudo" problem.
 >
 > The stack script isn't very big, and perhaps I'm just pre-coffee but I
 > couldn't find anything there about sudo.
 >
 > Where should I be looking?

Coffee helped.  I was looking in "the stack itself", and then for a 
"Hardware" section, overlooking the "Raspberry Pi" section right there 
in front of me once I thought to scroll down to look for it. :)

It seems the "files" method is using a mounted virtual file system, 
similar to /proc or /run/shm, which are actually elements in RAM 
accessible through file-like paths in keeping with the Unix tradition of 
"everything is a file".  This appears to be the common method for 
obtaining GPIO data:
<https://sites.google.com/site/semilleroadt/raspberry-pi-tutorials/gpio>

Thanks for maintaining the Master Lib - with what's there I should be 
able to poke around and get what I need.

One last question for now:  is there any mechanism accessible to use in 
LiveCode that allows our app to subscribe to events in /sys/class/gpio, 
or do we need to poll for changes?

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com




More information about the use-livecode mailing list