Support Forum

Share your projects and post your questions

Register   or   Sign In
The Forum

Writepin()

1 Views - Created 07/09/2023

07/09/2023

Posted by:
Woto

Woto Avatar

Hello all,
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

andrew Avatar

Location:
United Kingdom

andrew Twitter  andrew Website  

Hello

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

Woto Avatar

Hello Andrew,
Thank you very much for your answer. It helps me a lot.
Many greetings
Woto

Sign in to post your reply

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.