Welcome, Guest

Author Topic: Linux Gpio  (Read 2246 times)

Lukas Mistr

  • Newbie
  • *
  • Posts: 29
  • Karma: +0/-0
Linux Gpio
« on: December 22, 2014, 03:33:49 PM »
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
« Last Edit: December 22, 2014, 03:40:57 PM by Lukas Mistr »

Lukas Mistr

  • Newbie
  • *
  • Posts: 29
  • Karma: +0/-0
Re: Linux Gpio
« Reply #1 on: January 12, 2015, 10:03:34 AM »
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