I don't think that answers my question. I have a python program (using pigpio) that monitors the state of the gpios. It can show the current level (high or low). I could modify it to also show if the pin is configured for input or output. What I would like to do is also show if the internal resistor is active and whether it is pullup or pulldown.texy wrote:Hi,
not quite what your asking, but in a round about way it does answer the question :
No. The pull states are held in hardware latches, not registers, and the interface to them is write-only. It is your responsibility to set them correctly. In the unlikely event that you need to remember how they were set you must do that yourself too.RogerW wrote:Slightly off topic but is there any way for a program to detect the state of the internal pullup/down resistors? I know I can set them.
Interestingly this seems to vary quite a lot. I have two pis - a B+ with rasbian inder noobs and a pi2b under straight raspian. On the pi2b GPIOs 7 & 8 are outputs, on the b+ they are inputs. There are a number of other differences.joan wrote:GPIOs 0-8 default to inputs with a weak pull-up to 3V3 at power-on. The other GPIOs default to inputs with a weak pull-down to ground at power-on.
Some GPIOs will be updated depending on what modules such as SPI you load during boot. I have no explanation for GPIO19.
Code: Select all
if gameName is already being used: print('You are very angry!') self.BlowUp