Writepin()
The IO Pi Plus is a 32 channel MCP23017 GPIO expander for the Raspberry Pi
07/09/2023
Posted by:
Woto
I am new here and I am trying to switch an output with the writepin() function. My question is, does the output have to be written to constantly with writepin(1,0)?
Or is it enough that the command is executed once until it is switched off with another command writepin(1,1)?
Many greetings
Woto
07/09/2023
Posted by:
andrew
Once you have sent a command to the IO Pi it will keep the same state until another command is sent.
The python library will set the pins as inputs when an IOPi object is initialised so if your program restarts it will set any outputs to be inputs. To stop this you can set the initialise parameter to false when you create an IOPi object.
bus = IOPi(0x20, false)
07/09/2023
Posted by:
Woto
Thank you very much for your answer. It helps me a lot.
Many greetings
Woto
Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view.
Download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.