I am using beaglebone to access digital input from specific pin using sysfs interface. And I can change the output states but not the input :(. What I did is, I have two pins pinA and pinB. pinA I made it output and pinB I made input. Connected pinA to pinB. Configured pinA as output pin by sending out to direction attribute in sysfs and pinB as input by passing in. And I changed value of PinA to 1 and it is giving 1 as output (I tested using LED). But when I read the value of PinB it is giving 0 only, even I pass 0 to value of pinA. what may be the reason ?
Thank you 🙂
As I understood, the steps you followed:
I also did the same mistake and it took me hours, but the answer was simple: The first line starting with “echo 7” is the problem. Look at the muxing bits:
You were entering echo 7 which is –> 0 0 0111 and it means: bit 0,1 and 2 is 1, so the mode is set. No problem. However you just forgot to set whether it’s an input or output. And it should be like this:
your bits are now: 1 0 0111 binary which is 0x27 (hex).
When you write “cat /sys/class/gpio/gpio38/value” while giving input, you can see a wonderful 1 🙂 I’m sure you will be very happy as much as I was 🙂
Also, one more thing, you are right for Analog input about 1.8V, but GPIO operates with 3.3v.