Google Groups

Re: GPIO use

Bruno Niklaus Nov 30, 2011 11:42 PM
Posted in group: pandaboard
hi e3bble,

how do you try to use the GPIOs?
Does the gpio-sysfs method word?
E.g for reading gpio 49 and writiting gpio50
$cd /sys/class/gpio
$echo 49 > export
$echo 50 > export
$echo in > gpio49/direction
$echo out > gpio50/direction
$echo 1 > gpio50/value [this sets gpio50 to high]
$cat gpio49/value [this reads gpio49]

you can open the gpio's as file in any normal c/c++ application. but if it needs to be fast
its better to write a kernel module then use the gpio-sysfs