Support Forum

Share your projects and post your questions

Register   or   Sign In
The Forum

Writepin()

The IO Pi Plus is a 32 channel MCP23017 GPIO expander for the Raspberry Pi

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

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.

Home

Shop

Learn

Forum

FAQ

Contact

0 item

Your cart is empty

Please browse our shop to order from the wide range of Raspberry Pi boards and accessories.

Subtotal:£0.00
View Basket Continue to Checkout