Read GPIO problem
#10
(08-07-2017, 12:11 AM)pfeerick Wrote: If I export a pin, and then read the direction parameter, and see that it is "in", and it doesn't work, then I call that a bug, because it is not doing what it says it should be doing. Simple as that. 

Except that it IS NOT as simple as that.

... Exporting a pin doesn't set anything.  The export only makes the pad available in user space; that's all, exporting alone is not a complete operation, and as incomplete it alone does not guarantee anything about the state of the pin nor the direction, nor the pullup|pulldown. You must also set the direction and if input set the pull, and if output set the value;  with the /sys/class/gpio/  method it really is as complicated as that on the PineA64. 

Now then, if you don't want to do the complete operation, well that's fine;  except that it won't work -- simple as that.

Tongue




Note:  I do understand 'what' everyone believes export "should" accomplish, and I certainly also believe that it should be possible to guarantee the default operation of an exported pad;  however, my personal 'reality' is that it is more important to help users understand the complete operation rather than arguing over what 'should' be happening.  At the end of the day, do you want the pad to work or not ??  That's the simple question you need to answer for yourself.
marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )
  Reply


Messages In This Thread
Read GPIO problem - by shworker - 02-21-2017, 04:00 AM
RE: Read GPIO problem - by Techsensei - 02-21-2017, 06:41 AM
RE: Read GPIO problem - by shworker - 02-21-2017, 08:58 AM
RE: Read GPIO problem - by MarkHaysHarris777 - 02-22-2017, 04:23 AM
RE: Read GPIO problem - by aromring - 08-05-2017, 09:59 PM
RE: Read GPIO problem - by MarkHaysHarris777 - 08-05-2017, 10:24 PM
RE: Read GPIO problem - by pfeerick - 08-06-2017, 01:33 AM
RE: Read GPIO problem - by MarkHaysHarris777 - 08-06-2017, 10:38 AM
RE: Read GPIO problem - by pfeerick - 08-07-2017, 12:11 AM
RE: Read GPIO problem - by MarkHaysHarris777 - 08-07-2017, 07:21 AM
RE: Read GPIO problem - by pfeerick - 08-07-2017, 07:21 PM
RE: Read GPIO problem - by MarkHaysHarris777 - 08-07-2017, 11:10 PM
RE: Read GPIO problem - by pfeerick - 08-08-2017, 06:20 PM
RE: Read GPIO problem - by MarkHaysHarris777 - 08-15-2017, 02:24 AM
RE: Read GPIO problem - by martinayotte - 08-17-2017, 01:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  RPi.GPIO python module for Pine A64/A64+ aquilegia 98 132,600 12-15-2022, 08:40 PM
Last Post: Fadazo
  fm transmitter with gpio weasel18 2 4,862 09-10-2019, 04:28 AM
Last Post: desai_amogh
  How to use dts or other setup to declare gpio pin Interrupt (e.g. a button)? dkebler 1 3,623 06-12-2019, 10:37 AM
Last Post: dkebler
Lightbulb Sample GPIO codes highlighting RPi.GPIO-PineA64 and the PI bus MarkHaysHarris777 6 11,207 06-07-2019, 12:37 AM
Last Post: tllim
Star GPIO, SPI and I2C C++ Lib databit 7 11,299 02-04-2019, 05:45 AM
Last Post: Jeff R
Information Howto: Controlling Pine64 GPIO via the filesystem (sysfs) on linux pfeerick 4 11,928 01-24-2019, 03:36 AM
Last Post: Fifth
  GPIO and SPI SamR1 20 31,825 03-15-2018, 10:32 AM
Last Post: jomoengineer
Question GPIO shockr 7 14,878 03-11-2018, 01:52 AM
Last Post: jomoengineer
  GPIO fiq capability joseph 3 6,150 11-10-2016, 06:07 PM
Last Post: joseph
  RPI2-GPIO mus1c 6 9,154 09-22-2016, 05:28 AM
Last Post: mus1c

Forum Jump:


Users browsing this thread: 2 Guest(s)