I cannot output to GPIO pins.

At first, I write GPIO number to “/sys/class/gpio/export”.

so I try command “sudo echo 38 > /sys/class/gpio/export”.

But I get error “Permission denied”.

How should I do?

I connnot understand why super user can’t write to export…

You can “sudo su” or write a udev rule to change the ownership of the /sys/class/gpio sysfs tree.

“sudo” and I/O redirections ( < and > ) don’t work together. The shell intercepts the > , and tries to open the file as you before doing the sudo. Try:

sudo sh -c “echo 38 >/sys/class/gpio/export”

Thank you so much!!

I can do that.

But I had new problem.

The pin P8_3 that GPIO number is 38 can’t output voltage…

I connected a LED through the resistance to P8_3 from GND.

But the LED don’t light…

I wrong how to connect the LED?

If you have an led with a forward current of 2ma and a forward voltage of 1.6v, connecting to the gpio pin directly, you would need a resistor of (3.3 - 1.6)/.002 = 850Ohms, a 1K resistor would probably work.
If you have an led with a forward current of 20ma you need to add a transistor to get the needed current boost because the gpio current output is limited to either 4ma or 6ma. Check the Device Summary for the AM335x from TI for the current limits of your gpio pin.
Chad