PINE64
Questions about GPIO - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PINE A64(+) (https://forum.pine64.org/forumdisplay.php?fid=4)
+--- Forum: Linux on Pine A64(+) (https://forum.pine64.org/forumdisplay.php?fid=6)
+--- Thread: Questions about GPIO (/showthread.php?tid=294)

Pages: 1 2


RE: Questions about GPIO - patrickhwood - 02-16-2016

(02-16-2016, 03:15 PM)limitlesscodes Wrote: Alright, so I kind of figured out pin assignment using the GPIO image on the wiki. I still would like to know what PC, PD, PH, etc. means and when to use them vs. others. Also I would like to know if there is any better way of exporting the pins through C rather than doing something like:
Code:
//near beginning of file
system("echo 71 > /sys/class/gpio/export")
and
Code:
//near end of file
system("echo 71 > /sys/class/gpio/unexport")

You can fopen the file and write the string "71" to it like your first post.  That's essentially what the echo is doing.


RE: Questions about GPIO - limitlesscodes - 02-17-2016

(02-16-2016, 11:45 PM)patrickhwood Wrote:
(02-16-2016, 03:15 PM)limitlesscodes Wrote: Alright, so I kind of figured out pin assignment using the GPIO image on the wiki. I still would like to know what PC, PD, PH, etc. means and when to use them vs. others. Also I would like to know if there is any better way of exporting the pins through C rather than doing something like:
Code:
//near beginning of file
system("echo 71 > /sys/class/gpio/export")
and
Code:
//near end of file
system("echo 71 > /sys/class/gpio/unexport")

You can fopen the file and write the string "71" to it like your first post.  That's essentially what the echo is doing.
You are right! I knew I was missing something :p thanks.