Linux Gpio

Started by Lukas Mistr, December 22, 2014, 03:33:49 PM

Previous topic - Next topic

Lukas Mistr

Hello,
I would like to use Linux GPIO pins 39 and 38 (LCD_D06, LCD_D07), but I can not be exported. Could you advise me?


/home/examples/led_blink/led_blink: line 7: /sys/class/gpio/gpio39/direction: No such file or directory
/home/examples/led_blink/led_blink: line 8: /sys/class/gpio/gpio38/direction: No such file or directory
/home/examples/led_blink/led_blink: line 10: /sys/class/gpio/gpio38/value: No such file or directory
/home/examples/led_blink/led_blink: line 11: /sys/class/gpio/gpio39/value: No such file or directory



echo 38 > export
echo 39 > export

echo out > /sys/class/gpio/gpio6/direction
echo out > /sys/class/gpio/gpio7/direction
echo out > /sys/class/gpio/gpio25/direction
echo out > /sys/class/gpio/gpio39/direction
echo out > /sys/class/gpio/gpio38/direction

echo 1 > /sys/class/gpio/gpio38/value
echo 1 > /sys/class/gpio/gpio39/value

while [ 1 -eq 1 ]
do
echo 1 > /sys/class/gpio/gpio7/value
sleep 0.1
echo 1 > /sys/class/gpio/gpio6/value
sleep 0.1
echo 1 > /sys/class/gpio/gpio25/value
sleep 0.1
echo 0 > /sys/class/gpio/gpio6/value
echo 0 > /sys/class/gpio/gpio7/value
echo 0 > /sys/class/gpio/gpio25/value
"/home/examples/led_blink/led_blink" 26 lines, 623 characters

Lukas Mistr

From the original version 2.6.35-8-ARCH I switched to 3.12.0-rc3-dirty. Pins started to work. What problem is the official version 2.6.35-8-ARCH do not know but with a newer kernel works without any problems.

The only change was in the export of pins with this command
echo 38> / sys / class / GPIO / export
echo 39> / sys / class / GPIO / export